Link to home
Start Free TrialLog in
Avatar of micromarch
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
Avatar of NorCal2612
NorCal2612

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ozo
@array = reverse sort @array;
print "@array[0..4]\n";