What I\'m looking for is something like:
@list = qw(1 2 3 4 5 6); foreach (@list) { #perl magic goes here print \"i: $i, j:$j\\n\"; }
Risking the necromancy tag, I decided to add one more from Tim Toady's backpack:
for (0 .. $#list) { next if $_ % 2; my ($i, $j) = @list[$_, $_ + 1]; say "i:$i, j:$j"; }
Nondestructive, no duplicate lists, no state variables and reasonably terse.