Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Answer: How do I Loop over multiple arrays simultaneously ?

by jdporter (Canon)
on Aug 07, 2012 at 15:44 UTC ( #986021=categorized answer: print w/replies, xml ) Need Help??

Q&A > arrays > How do I Loop over multiple arrays simultaneously ? - Answer contributed by jdporter

use List::MoreUtils::each_array:
use List::MoreUtils qw( each_array ); my @a = qw( a b c ); my @b = qw( A B C ); my @c = qw( 1 2 3 ); my $ea = each_array( @a, @b, @c ); while ( my( $a, $b, $c ) = $ea->() ) { print $a, $b, $c; }
:-)

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2017-09-26 22:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (298 votes). Check out past polls.

    Notices?