Link to home
Start Free TrialLog in
Avatar of jgore
jgore

asked on

Sort a Hash by Values routine?

Sort a Hash by Values routine?

I'm writing a routine that interprets a Log file.
I'm saving the info about browsers in a hash and wish to show the Top-20 Browsers.
Like:    Mozilla/4.77   would be a log entry ,key, for netscape with perhaps the value of '50'.

My dumb problem:
Once I have a hash full of browser names as key, and how many hits for each in values.....what then?  What is an elegant way to find the top-20 ???

ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

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 jgore
jgore

ASKER

Thank you Ozo!
Worked like a charm!