my @a=@array; # make a copy, since we will destroy @a my $prev=pop @a; for (reverse @a){ print $prev - $_, "\n"; $prev=$_; }