boom has asked for the wisdom of the Perl Monks concerning the following question:
I want to sort a hash which actually has a hash as a value. For instance:
my %hash1=( field1=>"", field2=>"", count=>0, ); my %hash2; $hash2{"asd"}={%hash1};
and I inserted lots of hashes to %hash2 with different count values of %hash2. How can I sort the %hash1 according to a count value of hash1? Is there a way of doing this without implementing quicksort manually, for instance with the sort function of Perl?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How can I sort a hash of hashes by key in Perl?
by Corion (Patriarch) on Apr 18, 2009 at 13:09 UTC | |
|
Re: How can I sort a hash of hashes by key in Perl?
by CountZero (Bishop) on Apr 18, 2009 at 18:03 UTC | |
|
Re: How can I sort a hash of hashes by key in Perl?
by ww (Archbishop) on May 30, 2010 at 23:56 UTC |