Hi monks!
I have an array and want to do something on every two succeding elements (its already sorted by a fancy sortfunction) At this moment I use the following ugly code
my $oldelem=0 # which cannot occur.
foreach $elem (@elements) {
do_something_with($oldelem,$elem)
unless $oldelem==0;
$oldelem=$elem;
}