in reply to File Sorting Rephrased

I would reach into the toolbox for sort, and do:
sort -n -r -k 3 file -o outfile
sort numerically, reversed, on the third key, write into outfile.

and in perl:
my @args = qw/ sort -n -r -k 3 file -o outfile /; system( @args ) == 0 or die "something went wrong with: @args: $?\n";