http://qs321.pair.com?node_id=39590

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question: (arrays)

# This works:
@a = (1,1,1); @b = (2,2,2); foreach $i (0 .. $#a) { $a[$i] += $b[$i]; }
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:
@a = map $a[$i] + $_, @b;
Or is it simply not worth it?

Originally posted as a Categorized Question.