perlquestion
Anonymous Monk
array
index
map
# This works:
<CODE>
@a = (1,1,1);
@b = (2,2,2);
foreach $i (0 .. $#a) {
$a[$i] += $b[$i];
}
</CODE>
but I'd like to use map.
Is there a way to access the map index [$i] variable so
I can do something like this:
<CODE>
@a = map $a[$i] + $_, @b;
</CODE>
Or is it simply not worth it?
<p><i>Originally posted as a Categorized Question. </i></p>
7