I think I should explain my problem a bit more in detail:
I have a hash like
my $test = (
'a' => {
'identifiers' => {
'mrt1' => 1,
'mrt2' => 1,
'mrt3' => 1,
},
},
'b' => {
'identifiers' => {
'mrt2' => 1,
'mrt3' => 1,
'mrt6' => 1,
},
},
'c' => {
'identifiers' => {
'mrt1' => 1,
'mrt2' => 1,
'mrt3' => 1,
},
},
'd' => {
'identifiers' => {
'mrt2' => 1,
'mrt3' => 1,
'mrt6' => 1,
},
},
'sum_ab' => {
'values' => {
'a' => 1,
'b' => 1,
},
},
'sum_cd' => {
'values' => {
'c' => 1,
'd' => 1,
},
},
'sum_abcd' => {
'values' => {
'sum_ab' => 1,
'sum_cd' => 1,
},
},
);
In case of mrt1 I do something, because a is matched.
Afterwards I need to do something, because sum_ab has a in its 'values'-hash. Afterwards I have to check if some sum includes 'sum_ab' and so on...
That is the reason, why I wanted to use the nested iteration over the same hash.
Perhaps I could push to some temporary variable and do the second while after the first one.
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.