Hey all, once again;

I'm using a hash of a hash of a hash to store some numeric information, and using the actual hash key as a value to be retrieved to be associated with that numeric value for print out. It all representing a score that allows my program to include or exclude that key value to be/or not to be printed out.

When my program decides to save the key and change increment the number, another value is also incremented added to a different hash of a hash within the same base hash a la;

$Stats{$DestPort}++; $Stats{$DestPort}{covert}{"$intSrcFound|$hshIPtoDomainIndex{$strDst}|$ +DstIP|$SrcIP|$DestPort|$Protocol"}++;
But, when I try to retrieve the values, I end up with keys that contain a different $DestPort than the $DestPort I have specified for $Stats{$DestPort}.

So, my program obtains a list @TopPorts, and I iterate through this list, during which time I sort the hash by it's keys and do the following:

foreach $entry (sort keys %{ $Stats{$TopPorts[$a]}{covert} }) { # my code to print out various HTML # elements is typically here }
Which is where I run into the aforementioned problem of $entry containing an element that should corrospond to $TopPort$a being completely off. Is there an issue with hashes of hashes contaminating each other, or is there some small property I'm unaware of here?

Thanks for everyone's help!

Update <FIXED>: Error occured due to reference conflict with integer/string. Thanks everyone.

In reply to hash of hash - incorrect values? by NathanE

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.