Is there a case in which we would specify something else for $a than for $b?
No.
And worse, you're calculating that value n * log2(n) * 2 times.
Sort::Key and related modules provide an interface where the key is only calculated n times.
In reply to Re: Notation of sort function
by ikegami
in thread Notation of sort function
by Alphaphi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |