Perl 5.8 and later shuffle large arrays before sorting. Note that
sort.pm is global and not lexical in scope.
For example:
#!/usr/local/bin/perl -w
use sort '_quicksort'; # Or _qsort, if you'd like
sort(@something);
mergesort is better than
quicksort for several reasons. First,
mergesort is more stable and does fewer
comparisons than quicksort, so
it's better for more complicated sorting routines.
In addition, mergesort takes preexisting order
into account.
 |  |  |
8.187. Socket |  | 8.189. Storable |