in reply to Traversing succeding sets of an array
for my $i (0..$#elements-1) { do_something_with($elements[$i],$elements[$i+1]); } [download]