mikejones has asked for the wisdom of the Perl Monks concerning the following question:
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...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, };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Comparing HoH and HoHoH
by liverpole (Monsignor) on Jan 17, 2007 at 15:34 UTC | |
by mikejones (Scribe) on Jan 17, 2007 at 18:33 UTC | |
|
Re: Comparing HoH and HoHoH
by eff_i_g (Curate) on Jan 17, 2007 at 15:29 UTC | |
by mikejones (Scribe) on Jan 17, 2007 at 19:09 UTC |