Thanks for reply.

At the end, I would expect 3 histograms with the keys being elements of the array and values equal to the count.

line = "0 1 6 2 68fd1e64 80e26c9b 1f89b562 e5ba7672"

0 is the variable for the switch, the rest of the line needs to be put into keys and then count/increment.

hist1={ "0" => 43, "0468d672" => 1, "05db9164" => 7, "07c540c4" => 2, "0a519c5c" => 1, "0b153874" => 14, "1" => 11, "10" => 1, "14" => 1, "15" => 1, "18" => 1, "1e88c74f" => 2, "1f89b562" => 3, "2" => 9, "241546e0" => 1, "287130e0" => 1, "287e684f" => 1, "2c16a946" => 2, } hist2={ "6c9c9cf3" => 1, "7" => 2, "776ce399" => 4, "7cd19acc" => 1, "8" => 1, "80e26c9b" => 2, "8cf07265" => 2, "8efede7f" => 1, "9b5fd12f" => 1, "ad4527a2" => 1, "ae46a29d" => 1, "b0660259" => 1, "bc6e3dc1" => 1, "be589b51" => 1, "d4bb7bd8" => 3, "d833535f" => 1, "e5ba7672" => 7, "f0cf0024" => 2, } hist3={ "3" => 2, "31" => 1, "3486227d" => 1, "361384ce" => 1, "37e4aa92" => 1, "38a947a1" => 1, "38d50e09" => 1, "3c9d8785" => 1, "4" => 3, "439a44a4" => 1, "5" => 3, "510b40a5" => 1, "5a9ed9b0" => 1, "6" => 1, "64523cfa" => 1, "68fd1e64" => 5, }

In reply to Re^4: Hashes, keys and multiple histogram by f77coder
in thread Hashes, keys and multiple histogram by f77coder

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.