in reply to Re^3: multi level hash terror - if statement to access specific elements
in thread multi level hash terror - if statement to access specific elements
Removing the print doesn't help - it is printing every last name in the database table. I just want it to print the surname of 'Gay' when it finds the first name 'Gay'. Only surnames should be printed whose first name is 'Gay' It seems to be printing every surname in the table.
Thanks for the help here :)for my $key (keys %names){ for my $key2(keys $names{$key}){ if ($names{$key}{$key2}[0] = 'Gay'){ print "Last Name:".$names{$key}{$key2}[1]."\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: multi level hash terror - if statement to access specific elements
by beech (Parson) on Feb 13, 2016 at 04:08 UTC | |
by hungrysumo79 (Initiate) on Feb 13, 2016 at 04:45 UTC | |
by beech (Parson) on Feb 13, 2016 at 07:56 UTC | |
by soonix (Chancellor) on Feb 17, 2016 at 10:52 UTC |