in reply to Summing the elements of multiple arrays into a new array
map { $sum += $_ } @foo, @bar; [download]
use strict; my $sum = 0; my @foo = ( 2,4,6,8 ); my @bar = ( 200,400,600,800 ); foreach (@foo,@bar) { $sum += $_; } [download]