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
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};