in reply to How do I sort a list in reverse order?

Note that

@sorted=sort($b <=> $a) @sorted;   # for number

won't work, should be

@sorted=sort{$b <=> $a} @unsorted;

Originally posted as a Categorized Answer.