$,="\t"; print map { $y=$x; $x=$_; $x-$y } sort {$a <=> $b} (100, map {int(rand(100))} (1..4)) ;