HoH -------- 'jblow' => { 'uid' => '2195', 'gecos' => 'Joe Blow,,,', 'gid' => '20' }, snippet..... ( $name, $p, $uid, $gid, $gecos, $dir, $s ) = split( ':' ); $hash1{$name} -> {'uid'} = $uid; $hash1{$name} -> {'gid'} = $gid; $hash1{$name} -> {'gecos'} = $gecos; HoHoH ---------- $VAR1 = { 'jblow' => { '2195' => { 'gecos' => 'Joe Blow,,,', 'gid' => '20' } } }; snippet...... $hash2{$name}{$uid} = { gid => $gid, gecos => $gecos, };
I am now comparing so I grasp hashes and understand them more, in the first printed dump of HoH, there are 2 hashes called "hash1 and "name". hash1 has a key of name with values of uid,gid and gecos? uid,gid and gecos are accessed only through name, joe blow in this case? In the printed dump of HoHoH, there are 3 hashes called "hash2", "name" and "uid". hash2 has keys of name and uid with values of gid and gecos? gid and gecos are only accessible through hash uid? please provide any corrections in detail. thank you...

In reply to Comparing HoH and HoHoH by mikejones

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.