Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

RE: RE: A minor epiphany with grep and map

by ase (Monk)
on Jul 27, 2000 at 13:31 UTC ( #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
Node Status?
node history
Node Type: note [id://24649]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2018-10-22 21:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When I need money for a bigger acquisition, I usually ...














    Results (122 votes). Check out past polls.

    Notices?