As of Perl 5.12:
while (my ($i, $element) = each @array) { do_something( $element ) unless $i % 3; }
Improve your skills with Modern Perl: the free book.
In reply to Re^2: Perlplexation - foreach shoulda Known
by chromatic
in thread Perlplexation - foreach shoulda Known
by raybies
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |