in reply to Looping backwards through two arrays at once?

#since they're the same length... for(0..$#array1) { print $array1[$#array1 - $_]; print $array2[$#array2 - $_]; }
hope this helps.

UPDATE: Yeah, sorry, fixed 'em :).

Replies are listed 'Best First'.
Re^2: Looping backwards through two arrays at once?
by chester (Hermit) on Nov 04, 2005 at 17:11 UTC
    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. :)