$sic = 1711; $hash{$sic}{BUS} = 'Plumbing'; # A keyword in a business name $hash{$sic}{CAT} = 'Plumbing'; # Category $str[1] = 'Elite Plumbing'; foreach $sic (keys %hash){ # if the word in $hash{$sic}{BUS} is found in $str[1], # I want to know. # if ($hash{$sic}{BUS} =~ /$str[1]/) # This wont work. if (grep { $hash{$sic}{BUS} == $_ } $str[1] ){ # Nope # $str[38] = $hash{$sic}{CAT}; # $str[39] = $hash{$sic}{BUS}; print "Found one. Bus name is $str[1] and cat is " . $hash{$sic}{CAT} . " and sic is " . $str[39] ."\n"; } }