in reply to Re: Optimizing a sort function (wrap-around alpha)
in thread Optimizing a sort function (wrap-around alpha)

And yet another way:
my %h; push @{$h{$_ cmp $top}}, $_ for @unsorted; my @sorted = (@{$h{0}}, sort(@{$h{1}}), sort(@{$h{-1}}));
It's using a single pass bucket-sort as first step. Again note the absense of a sorting block.