I am curious.
I have created a Hash of Hash as follows:
$HoH{$last_name}{$first_name}{$birth_day}{$phone_num} = "$id_num";
I often know the values of ($last_name, $first_name) and would like to find the
$birth_day value for this individual.
Is there an elegant way to do this?
Naturally:
print "$HoH{$last_name}{$first_name}"; #only prints a memory address.
My solution was to use keys:
for my $birthday(keys %{$HoH{$last_name}{$first_name} } ) {
my $key_id = $HoH{$last_name}{$first_name};
print "Birthday = $birthday\n";
}
Is there a simpler soulution? Thanks for any suggestions as I spent considerable time fighting this!
I have created a Hash of Hash as follows:
$HoH{$last_name}{$first_name}{$birth_day}{$phone_num} = "$id_num";
I often know the values of ($last_name, $first_name) and would like to find the
$birth_day value for this individual.
Is there an elegant way to do this?
Naturally:
print "$HoH{$last_name}{$first_name}"; #only prints a memory address.
My solution was to use keys:
for my $birthday(keys %{$HoH{$last_name}{$first_name} } ) {
my $key_id = $HoH{$last_name}{$first_name};
print "Birthday = $birthday\n";
}
Is there a simpler soulution? Thanks for any suggestions as I spent considerable time fighting this!