in reply to Re: Sorting records on a single field
in thread Sorting records on a single field
In OP case:
@SortedData = sort { (split (/:/, $b))[-1] <=> (split (/:/, $a))[-1] } + @Data;
Using reverse also makes the sort operation unstable (entries with equal sorting keys do not keep their relative positions after the sort operation).
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Sorting records on a single field
by Lain78 (Initiate) on Jan 21, 2010 at 11:07 UTC | |
by salva (Canon) on Jan 21, 2010 at 11:28 UTC |