use Sort::Key qw(rikeysort); [download]
In reply to Re^3: most efficient buffer sort by salva in thread most efficient buffer sort by Anonymous Monk