bradcathey has asked for the wisdom of the Perl Monks concerning the following question:
Fellow Monasterians,
I couldn't get this map to work until I added the arrow operator, which I though was just for class methods and deferencing. Can someone explain what is going on with the arrow in this context, when nothing is being dereferenced AFAIK. Thanks.
my @pages = ( {'level' => '1','id' => 4}, {'level' => '2','id' => 10} ); my @ids = map { $_->{'id'} } @pages; print Dumper (@id); __END__ $VAR1 = 4; $VAR2 = 10;
—Brad
"The important work of moving the world forward does not wait to be done by perfect men." George Eliot
"The important work of moving the world forward does not wait to be done by perfect men." George Eliot
Back to
Seekers of Perl Wisdom