theantler has asked for the wisdom of the Perl Monks concerning the following question:
I understand that we have ref to an anonymous hash, but along the lines in the book, we want more than just one record, we want many, so the book suggests that create a %byname hash that we use this way:$record = { NAME => "Jason", EMPNO => "132", (etc..) };
What is the idea with this? We now have a hash of a hash, with the value of the $byname key (name) is the reference to the record ..?? How do we get many records from such a contruction? I think it is a bit confusing. Regards, ta$byname {$record->{NAME}} = $record;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Example in Cookbook of hash of hash
by ikegami (Patriarch) on Mar 26, 2010 at 17:33 UTC | |
by theantler (Beadle) on Mar 26, 2010 at 18:58 UTC | |
by ikegami (Patriarch) on Mar 26, 2010 at 19:17 UTC | |
by theantler (Beadle) on Mar 26, 2010 at 19:26 UTC | |
by ikegami (Patriarch) on Mar 26, 2010 at 20:37 UTC | |
by theantler (Beadle) on Mar 27, 2010 at 07:56 UTC | |
by theantler (Beadle) on Mar 27, 2010 at 09:26 UTC | |
|
Re: Example in Cookbook of hash of hash
by toolic (Bishop) on Mar 26, 2010 at 17:38 UTC | |
|
Re: Example in Cookbook of hash of hash
by planetscape (Chancellor) on Mar 26, 2010 at 21:12 UTC |