Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Looping backwards through two arrays at once?

by chester (Hermit)
on Nov 04, 2005 at 17:11 UTC ( #505789=note: print w/ replies, xml ) Need Help??


in reply to Re: Looping backwards through two arrays at once?
in thread Looping backwards through two arrays at once?

If you want to do it this way, shouldn't it be

for(0..$#array1) { print $array1[$#array1 - $_]; print $array2[$#array2 - $_]; }

EDIT: Oops, you fixed the array index. But you still have your $# reversed on two lines. :)


Comment on Re^2: Looping backwards through two arrays at once?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2014-12-27 08:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls