in reply to numerical and non numerical sorts

Using <=> will compare numerically, using cmp compare lexicographically. But you have to tell Perl how you want to sort - Perl cannot magically find out how you want to sort.
Perl --((8:>*