There's more than one way to do things | |
PerlMonks |
Re: Not understanding the arrow operatorby DStaal (Chaplain) |
on May 18, 2009 at 20:05 UTC ( [id://764718]=note: print w/replies, xml ) | Need Help?? |
You are dereferencing: You have an array of hashes (or, more correctly an array of references to hashes) in @pages, so $_ in the map is a reference to a hash. This is partially hidden by the normal syntax, because perl is smart enough to realise when you type $pages[1]{id} you mean $pages[1]->{id}. (Because there is no other way element 1 of @pages could be a hash: Arrays can only hold scalars, and they only way to get a hash into a scalar is to use a reference.)
In Section
Seekers of Perl Wisdom
|
|