Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Thanks, I hope I was clear in my question.my @arr_of_names = qw(Mary John Ann); my $txt; my $table = qq|<table>|; foreach my $key ( sort(keys %$all_names )) { foreach my $name ( @arr_of_names ) { if($name eq $key) { $txt = "BAD"; $table = $table. qq|<tr><td>$txt - $key</td></tr>"; }else{ $txt = "GOOD"; $table = $table. qq|<tr><td>$txt - $key</td></tr>"; } } $table = $table. qq|</table>|; print $table;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Finding hash keys in array
by Grimy (Pilgrim) on May 29, 2013 at 18:42 UTC | |
|
Re: Finding hash keys in array
by kcott (Archbishop) on May 30, 2013 at 05:15 UTC | |
|
Re: Finding hash keys in array
by LanX (Saint) on May 29, 2013 at 18:01 UTC |