for(my $i=1; $i < @array; $i++){ print "The difference is ", $array[$i] - $array[$i-1], "\n"; }