for my $offset ( 0 .. $#ary_a ) { foobar( $ary_a[ -$offset ], $ary_b[ -$offset ] ); }
This is the reply I was going to give but you're suffering from an off-by-one error. It should be:
for my $offset (1..@ary_a) { foobar( $ary_a[ -$offset ], $ary_b[ -$offset ] ); }
In reply to Re^3: Looping backwards through two arrays at once?
by duff
in thread Looping backwards through two arrays at once?
by Spidy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |