in reply to Re: Predefined Sort
in thread Predefined Sort
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Predefined Sort
by Fletch (Bishop) on Jun 20, 2008 at 17:34 UTC | |
by kyle (Abbot) on Jun 20, 2008 at 17:47 UTC | |
|
Re^3: Predefined Sort
by krusty (Hermit) on Jun 20, 2008 at 17:25 UTC | |
by kyle (Abbot) on Jun 20, 2008 at 17:36 UTC |