my @idx = 0 .. $#array; pairwise { do_something_with($b, $a) } @idx, @array;