Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: How do I Loop over multiple arrays simultaneously ?

by simmisam (Novice)
on Feb 03, 2014 at 00:46 UTC ( [id://1073112]=note: print w/replies, xml ) Need Help??


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

Try this

my $index = $ARGV[0]; chomp($index); my @a1 = qw("a" 'b' 'c' 'd'); my @a2 = qw('A' 'B' 'C' 'D' 'E'); my @a3 = qw(1 2 3 4 5 6 7 8 9); multipleArray(\@a1,\@a2,\@a3); sub multipleArray { while (@_) { my $array = shift; print "${$array}[$index]\n"; } }

Originally posted as a Categorized Answer.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1073112]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2026-03-12 07:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.