What if you did not know the names of the keys under the parent like the following. This was extracted from data dumper.
$VAR1 = '4'; $VAR2 = { '' => '', '35' => 'D', '11' => '3104052', '63' => '0', '167' => 'FUT', '200' => '200512', '1' => '2', '44' => '112.55', '55' => 'XEURFGBM0F2005Z', '50' => 'portwaretrader1', '40' => '2', '57' => 'RISKGATEWAY', '15' => 'USD', '38' => '1', '52' => '20051118-07:31:46', '59' => '0', '60' => '20051118-07:31:40', '34' => '37', '56' => 'EXLINK_CAMPBELL', '49' => 'CAMPBELL_EXLINK', '10' => '170', '54' => '1' };
So the parent keys are just numbers like 1.2.3.4.4.5.5 and i have a counter which holds how many keys are in the %messagebin hash, so what i want to be able to do is sort and process each key under the parent with the value.
Something like
for my $file (sort keys %messagebin) { #enter into key $messagebin{$file} then foreach my $key in the above print out $key = $value }
Sorry does not make much sense.

In reply to Re^2: Looping through hash of hashes by minixman
in thread Looping through hash of hashes by minixman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.