If you don't mind destroying your array in the process, you can use splice.
while (my ($el1, $el2) = splice(@list, 0, 2)) { # do stuff }
In reply to Re: How do I loop through a list two or more elements at a time?
by davorg
in thread How do I loop through a list two or more elements at a time?
by moodster
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |