XP is just a number | |
PerlMonks |
Re^4: Possible useless use of mapby JavaFan (Canon) |
on Mar 18, 2010 at 15:04 UTC ( [id://829418]=note: print w/replies, xml ) | Need Help?? |
Just like about any other operator in Perl, map imposes a certain context on its operands, regardless of the context it itself is in. In:
there are actually two lists, both containing a single element: the first list consists of $hash->{foo}, the second of 1. Think of it this way, if map would not provide list context to its inner block, the following wouldn't do what it does now:
In Section
Seekers of Perl Wisdom
|
|