The usual idiom is:
my @ARRAY = (...); my @result = map { do something with $_ and $ARRAY[$_] } 0..$#ARRAY;
Then, $_ is giving you the index of the element, and you indirect it to get to the element itself.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.


In reply to •Re: Is there an equivalent $. for lists or arrays in map or foreach? by merlyn
in thread Is there an equivalent $. for lists or arrays in map or foreach? by bsdz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":