in reply to Re: Example in Cookbook of hash of hash
in thread Example in Cookbook of hash of hash

When we make the value of $byname the reference to $record, I thought that we would get the same reference over and over again. I dont see where the reference changes, but I can see from the dump that it does in fact and work just fine.
  • Comment on Re^2: Example in Cookbook of hash of hash

Replies are listed 'Best First'.
Re^3: Example in Cookbook of hash of hash
by theantler (Beadle) on Mar 27, 2010 at 09:26 UTC
    Guys, THANK you, especialy Ikegami for taking the time to help me. I finally figured out the for-loop by writing in this way making it more clear to me:
    my %byname; use Data::Dumper; for my $record ( { NAME => "Jason", EMPNO => "132" }, { NAME => "Orang +e", EMPNO => "133" } ) { $byname{ $record->{NAME} } = $record; }; print $byname{Orange}->{EMPNO};