As far as getting into the internals with sort, just
told Perl to
sort{1}split//,"Just another Perl hacker.\n",
printed the result (assigned to an array and interpolated),
and then worked out from the ordering it produced where
it was moving things, and where I had to put them to get
the right order.
Playing with it was inspiring, and i attempted to roll my own a bit. Very fun!
For portabilities sake you might want to use sort '_qsort', which fixed it for me, if perl 5.8.0. It's 3am, and i've just had one of the weirdest sober nights in my life, so i'm in no condition to think of how to selectively load pragmatic modules right now.
I've found a more portable way to abuse sort: use a
sort function that does result in a defined order, but
obfuscate it. For a (quite rudamentary) example, see
my new signature:
Of coures, for serious obfuscation something much more
obscure than modular arithmetic would be called for
in the sort function, but this is just a JAPH.