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 ???
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Worked like a charm!