in reply to Re: Fast way to check if a sort was doen
in thread Fast way to check if a sort was doen
printed these results:my @oldarray = (0..9); my @array = sort { my $result = ($a cmp $b); print "$result "; $result } @oldarray; print "\n@array\n";
Without knowing exactly how the sorting algorithm is implemented, I don't see how we could reliably use this kind of method.-1 -1 -1 -1 -1 -1 1 -1 1 1 1 -1 1 -1 1 1 1 1 1 0 1 2 3 4 5 6 7 8 9
|
|---|