my $max = ($#foo > $#bar) ? $#foo : $#bar; # or we can assert they have the same size? @foobar = map { $foo[$_] + $bar[$_] } (0..$max);