http://qs321.pair.com?node_id=83422


in reply to Idiom for looping thru key/value pairs

Please correct me if I'm wrong, but perhaps you could use splice ?

#!/usr/bin/perl -w use strict; my @list = ('1','val','2','val2','1','val3'); while((my $first, my $last) = splice(@list,0,2)) { print "$first -> $last \n"; }

HTH