I have this HoH
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",
},
},
);
Using "Test1" I want to sort it by "value1" and display something like:
for "Test1"
SUB2 has value1=2800
SUB1 has value1=2300
OTHERSUB value1=2000
etc.
I don't know how to sort so deep in a hash of hashes or even deeper. Can someone please advice?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.