use List::Util qw/reduce/; @foobar = @{reduce{[map $a->[$_]+$b->[$_], 0..@$a>@$b?$#$a:$#$b]} \(@foo, @bar, @baz, @etc};