Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2016-12-09 12:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (150 votes). Check out past polls.