in reply to Is there an equivalent $. for lists or arrays in map or foreach?
Then, $_ is giving you the index of the element, and you indirect it to get to the element itself.my @ARRAY = (...); my @result = map { do something with $_ and $ARRAY[$_] } 0..$#ARRAY;
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is there an equivalent $. for lists or arrays in map or foreach?
by bsdz (Friar) on Sep 16, 2004 at 17:01 UTC |