in reply to Re: Adding two lists together
in thread Adding two lists together

Another approach to the pesky 'list of scalars':
>perl -wMstrict -le "use List::MoreUtils qw(each_array); my ($w, $x, $y, $z) = ( 1, 2, 3, 4); my @incs = (10, 20, 30, 40); my $ea_inc = each_array @incs; $_ += $ea_inc->() for $w, $x, $y, $z; print qq{w $w x $x y $y z $z}; " w 11 x 22 y 33 z 44
Note that nothing is done here to check that the list and the array have the same number of elements!