for (my $i = 0; $i < $#array; $i+=2) { my ($first, $second) = @array[$i, $i+1]; # Do stuff here ... }
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
In reply to Why do Perlers hate C-style for-loops, especially when they're called for?
by dragonchild
in thread 'each' syntax oddity?
by SuperCruncher
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |