@sorted=sort{$b cmp $a} @unsorted; # for strings @sorted=sort($b <=> $a) @unsorted; # for numbers