|We don't bite newbies here... much|
Sorting Keys and Valuesby mt2k (Hermit)
|on Apr 27, 2002 at 09:02 UTC||Need Help??|
mt2k has asked for the
wisdom of the Perl Monks concerning the following question:
Okay, I know that questions *similar* to this have been answered here before.
But mine requires what I believe is one more step that I cannot achieve with my peanut of a brain :)
Basically, I have the following hash:
This hash is a list of scores that users have obtained at a certain activity. What I want to do with this hash is print out a "trophy stand" type of output, that shows the users in a list from highest score to lowest and their scores. All users need to be placed in their proper position (such as 1st and 2nd place). The hash is much bigger than this. Pretend there are at least 30 users in the hash. Some of this is simple to do, but there is one thing I could not bypass: the exception of multiple users who have the same score.
What I have right now basically outputs my example hash as:
What the output should really look like is this, where tied scores are put at the same level:
Here is what I have for code:
I hope I was able to make myself clear on what I am asking for.