Perl question: array member of referenced hash
Shachar Shemesh
shachar at shemesh.biz
Sat Oct 24 23:25:38 IST 2009
Gabor Szabo wrote:
>
> err, I don't think that "casting" is the right word to use here. What
> {} does here is
> disambiguates the expression.
Let me try to summarize what I understood from your excellent explanation:
Putting a modifier in front of a reference dereference it to the right
type ($ for scalar etc.). Alternatively, putting a '->' (which is a
unary operator, not a binary one) also dereferences it, no matter what
it is pointing to.(at least for array and hash), so long as there is
some reference to its content on the operator's right (the same as it is
implemented in C++, only more confusing).
The curly braces act as a scoping operator, making the $/@/% relation to
parts of the expression unique.
All that is left is understanding why the round braces around the whole
expression.
Many thanks (the explanation was very useful)
Shachar
--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20091024/c6d3bf8a/attachment.html>
More information about the Linux-il
mailing list