For sorting in reverse order, this is easier to understand and executes just as quickly:
my @sorted = reverse sort {$a <=> $b} @dports
When you swap $a and $b, there's a much better chance that someone reading through later won't notice that (particularly if the expression gets bigger and more complicated). Sticking reverse in is obvious.
In reply to Re^2: Predefined Sort
by kyle
in thread Predefined Sort
by k_grdn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |