Note that allPrices is a reference to an array and ought be handled as a special case.

use strict; use warnings; my $itemHash = { '14260:771:0' => { 'allPrices' => [ 8900, 22000 ], 'itemMetrics' => '2:2:20100:0:0:2:30900', 'bidCount' => '0', 'minPrice' => '20100', 'itemClass' => '2', 'buyPrice' => '30900', 'buyCount' => '2', 'numCount' => '2', 'minCount' => '2', 'itemName' => 'Bloodwoven Bracers of the Owl', 'itemPrices' => '8900:22000', 'bidPrice' => '0', 'randomID' => '771', 'baseNum' => '14260', 'mean' => '400', 'median' => '300', 'mode' => '400', 'stdDev' => '100', }, }; for my $RealmFaction (keys %$itemHash) { for my $item (keys %{$itemHash->{$RealmFaction}}) { print "$item => $itemHash->{$RealmFaction}{$item}\n"; } }

Prints:

stdDev => 100 mode => 400 itemMetrics => 2:2:20100:0:0:2:30900 median => 300 minPrice => 20100 minCount => 2 itemPrices => 8900:22000 randomID => 771 baseNum => 14260 allPrices => ARRAY(0x1f125f4) bidCount => 0 mean => 400 itemClass => 2 numCount => 2 buyCount => 2 buyPrice => 30900 itemName => Bloodwoven Bracers of the Owl bidPrice => 0

DWIM is Perl's answer to Gödel

In reply to Re: some help w/ hashes by GrandFather
in thread some help w/ hashes by rael438

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.