in reply to Foreach in mulitple arrays

Adding the commas indeed work. However, there's another, more general possibility too: factor the loop body out to a function and use three different foreach loops. Like, instead of

for (@array1, @array2, @array3) { print "met $_"; }
you can write
my $body = sub { print "met $_"; } for (@array1) { &$body() } for (@array2) { &$body() } for (@array3) { &$body() }
This works even if you have a more complicated iterator than foreach.