http://www.perlmonks.org?node_id=1137063


in reply to Re: Advanced Sorting - GRT - Guttman Rosler Transform
in thread Advanced Sorting - GRT - Guttman Rosler Transform

The hardest part is inverting the portions of the key which must sort descending.
If the entire key is descending, you don't need to invert it; just using sort { $b cmp $a } is good enough. sort will recognize that specific code and not actually call the code block.
--
A math joke: r = | |csc(θ)|+|sec(θ)| |-| |csc(θ)|-|sec(θ)| |