in reply to sorting array of arrays reference

http://learn.perl.org/faq/perlfaq4.html#How-do-I-sort-an-array-by-anything-, http://perldoc.perl.org/perlfaq4.html#How-do-I-sort-an-array-by-%28anything%29%3f

After which use a array slice or splice to get the top N

Potential alternative that might be faster is Sort::Key::Top - select and sort top n elements