Don't ask to ask, just ask | |
PerlMonks |
How to sort Hashes of Hashes and print results in a fileby stan131 (Acolyte) |
on Mar 27, 2009 at 22:51 UTC ( [id://753797]=perlquestion: print w/replies, xml ) | Need Help?? |
stan131 has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks, I am working with Hashes of Hashes and need to sort based value. Here is output of my sort from Dumper Now in this each Hash key the number of values varies. First Key 1 has 11,21,7,17,2,22,1,18,23(where 11,21 are doc Id and each doc Id has value) Second Key 2 has 11,21,7,17,2,22,1,18 (where 11,21 are doc Id and each doc Id has value) I need 2 things 1) I need to sort based on document value for each key 2) Get the top 2 documents with highest docment value for each key Your help is appreciated. Thanks, Stan
Back to
Seekers of Perl Wisdom
|
|