Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Hash of Hash of Array Syntax help

by ikegami (Patriarch)
on Jan 12, 2012 at 23:37 UTC ( [id://947671]=note: print w/replies, xml ) Need Help??


in reply to Hash of Hash of Array Syntax help

@{ $genes{$r[0]}{$r[1]}{$r[2]} }

is short for

@{ $genes{$r[0]}->{$r[1]}->{$r[2]} }

which is equivalent to

@{ ${ ${ $genes{$r[0]} }{$r[1]} }{$r[2]} }

There are two notations for dereferencing.

  • The embedded* notation (${ $array }[4]) can be used to dereference anything that can be deferenced, but it's a bit clunky.

  • The arrow notation ($array->[4]) is cleaner, but it can only be used for some forms of dereferencing.

There's no arrow equivalent for @{ $array }, so using push @{ ... }, $r[3] was necessary.

* — I just made up that name. I don't know of any existing name for it.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-03-19 07:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found