It sounds like you want a hash of lists. Check out perldsc. When you write your sort function you can tell it to use an element of the child structure.
I hope I'm not doing your homework for you, but because I'm bored, beneath the spoiler is an attempt at the solution to the problem as I understand it. HTH.
In reply to Re: to sort hash wrt values corresponding to keys
by mwp
in thread to sort hash wrt values corresponding to keys
by ansh batra
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |