micromarch
asked on
how to sort a perl array in descending and printing out the top 5?
Hi. I need to sort a perl array in descending then printing out the top 5? help would be greatly apreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@array = reverse sort @array;
print "@array[0..4]\n";
print "@array[0..4]\n";
http://www.sysarch.com/Perl/sort_paper.html