Don't ask to ask, just ask | |
PerlMonks |
perlfunc:mapby gods (Initiate) |
on Aug 24, 1999 at 22:42 UTC ( [id://293]=perlfunc: print w/replies, xml ) | Need Help?? |
mapSee the current Perl documentation for map. Here is our local, out-dated (pre-5.6) version: map - apply a change to a list to get back a new list with the changes
map BLOCK LIST map EXPR,LIST
Evaluates the
BLOCK or
EXPR for each element of
LIST (locally setting
@chars = map(chr, @nums); translates a list of numbers to the corresponding characters. And
%hash = map { getkey($_) => $_ } @array; is just a funny way to write
%hash = (); foreach $_ (@array) { $hash{getkey($_)} = $_; }
Note that, because |
|