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).
In reply to Re^2: Sorting records on a single field
by salva
in thread Sorting records on a single field
by TStanley
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |