http://www.perlmonks.org?node_id=1028869


in reply to Re: Increment by 2 and by 1 in same loop.
in thread Increment by 2 and by 1 in same loop.

It's also possible to define (and initialize, if needed) two (or more) lexical loop variables entirely locally:

for (my ($i, $n) = (1, 2); $i < $limit; $i += 2, ++$n) { do_something_with($i, $n); }