for (my $i=0 ; $i < @list ; $i+=2) { my ($el1, $el2) = @list[$i,$i+1]; # do things with $el1 and $el2 }