use strict; my $sum = 0; my @foo = ( 2,4,6,8 ); my @bar = ( 200,400,600,800 ); foreach (@foo,@bar) { $sum += $_; }