Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

RE: RE: A minor epiphany with grep and map

by ase (Monk)
on Jul 27, 2000 at 13:31 UTC ( [id://24649]=note: print w/replies, xml ) Need Help??


in reply to RE: A minor epiphany with grep and map
in thread A minor epiphany with grep and map

Hmmmm.... I see your point. @{$x->{y}} _is_ probably a better way to clarify this to the parser(and to the poor soul who has to maintain the code somewhere down the line- probably me.)

Looking at perlop, I'm a little confused as to _why_ it works myself. Quoting from the Docs: (with my comments not in <code> tags)

The Arrow Operator ``->'' is an infix dereference operator, just as it is in C and C++. If the right side is either a [...], {...}, or a (...) subscript,
..It seems this describes the situation..
then the left side must be either a hard or symbolic reference to an array, a hash, or a subroutine respectively. (Or technically speaking, alocation capable of holding a hard reference, if it's an array or hash reference being used for assignment.) See the perlreftut manpage and the perlref manpage. Otherwise, the right side is a method name or a simple scalar variable containing either the method name or a subroutine reference, and the left side must be either an object (a blessed reference) or a class name (that is, a package name). See the perlobj manpage.
It seems somehow the -> is binding before the @ in @$x, contrary to what I see in perlop
I guess I should consider it a _feature_.
Thank you, chip for noticing something that I completely glossed over. Good brain food.
-ase

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://24649]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-03-28 16:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found