Quoth Jürgen Exner <
jurg...@hotmail.com>:
Annoyingly, while C<sort { $b <=> $a }> is optimized into a 'DESC' flag
on the sort op, C<reverse sort> is not. If it were it wouldn't be a
hack, be a good way of clearly expressing what you mean. (This is
especially annoying given that, AFAICS, the logic is there in pp_sort to
support the DESC flag with an arbitrary sort function, it just isn't
used.)
Even as it is, 'reverse' is pretty cheap: it doesn't allocate any
memory, it just reverses the list by shifting pointers around on the
stack (one pass through half the list), so it's not a bad way to sort
backwards if reversing the sense of the condition is non-trivial.
Ben