in reply to How do I Loop over multiple arrays simultaneously ?

my @a1 = qw( a b c d); my @a2 = qw( A B C D); my @a3 = qw( 1 2 3 4); my @a4 = qw( 11 22 33 44); zip(\@a1,\@a2,\@a3,\@a4); sub zip { for ( my $i = 0; $i <= $#{$_[0]}; $i++ ) { print map( @{$_}[$i], @_ ), "\n" ; } }

Replies are listed 'Best First'.
Re: Answer: How do I Loop over multiple arrays simultaneously ?
by Anonymous Monk on Dec 17, 2010 at 09:56 UTC
    Or use the zip function in List::MoreUtils, which is a common enough module to be installed almost everywhere anyway as a prerequisite to something else.