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;
In reply to Finding hash keys in array by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |