for my $i(0..scalar(@array)){ print "Jetzt: ",$array[$i]," -- vorher: ",$array[$i-1],"\n"; }