in reply to Foreach two arrays?

The simplest is probably:

foreach my $v1 (@array1) { my $v2= shift @array2; print $v1, $v2; }

Of course this relies on @array1 and @array2 having the same number of elements!

If the arrays can have different sizes then you can do:

# print all elements while( @array1 || @array2) { my $v1= shift @array1 || "empty"; # or whatever default value my $v2= shift @array2 || "empty"; print $v1, $v2; }
# print elements up to the shortest array length while( @array1 && @array2) { my $v1= shift @array1; my $v2= shift @array2; print $v1, $v2; }

I can't wait to see the golf versions!