my @oldarray = (0..9); my @array = sort { my $result = ($a cmp $b); print "$result "; $result } @oldarray; print "\n@array\n";