for $name(@names) { my $hash_key = $name; $person_has = $hash_Dref{$hash_key}; print "\t\t $name has $person_has\n"; # as intended, thru this line for my $item(@required) { # incorrect below; unless ( grep $person_has eq $_, $item ) { print "$name is missing $item.\n"; } else { print "$name has $person_has.\n"; } } }