mrc has asked for the wisdom of the Perl Monks concerning the following question:
Using "Test1" I want to sort it by "value1" and display something like:my %HoH = ( SUB1 => { Test1 => { value1 => "2300", value2 => "0.01", }, Test2 => { value1 => "5000", value2 => "0.34", }, Test3 => { value1 => "3000", value2 => "0.10", }, Test4 => { value1 => "7000", value2 => "0.33", }, }, SUB2 => { Test1 => { value1 => "2800", value2 => "0.05", }, Test2 => { value1 => "5500", value2 => "0.34", }, }, SUB3 => { Test1 => { value1 => "2700", value2 => "0.25", }, Test2 => { value1 => "5800", value2 => "0.45", }, }, );
I don't know how to sort so deep in a hash of hashes or even deeper. Can someone please advice?for "Test1" SUB2 has value1=2800 SUB1 has value1=2300 OTHERSUB value1=2000 etc.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sorting a hash of hashes
by NetWallah (Canon) on May 15, 2012 at 05:56 UTC | |
by mrc (Sexton) on May 15, 2012 at 06:52 UTC | |
by NetWallah (Canon) on May 15, 2012 at 13:48 UTC | |
by mrc (Sexton) on May 15, 2012 at 18:50 UTC | |
by NetWallah (Canon) on May 16, 2012 at 01:00 UTC | |
| |
|
Re: Sorting a hash of hashes
by Utilitarian (Vicar) on May 15, 2012 at 05:05 UTC | |
|
Re: Sorting a hash of hashes
by diddy_perl (Novice) on May 15, 2012 at 08:42 UTC |