# using a loop @foo = qw(1 2 3 4); @bar = qw(1 2 3 4); for ($i = 0; $i < 4; $i++) { $foobar[$i] = $foo[$i] + $bar[$i]; } # @foobar is now (2 4 6 8).
In reply to Summing the elements of multiple arrays into a new array by djw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |