in reply to Re: searching a scalar for a word. Should I use grep?
in thread searching a scalar for a word. Should I use grep?

Wow... thanks a bunch!!!! This worked !!!
Thanks for your very clear example.
I placed the prints on 2 - 3 lines for readability.
foreach $sic (keys %hash){ next if !$hash{$sic}{BUS}; print "str1 = $str[1] sic= $sic, cat= $hash{$sic}{CAT} bus= $hash{$sic}{BUS}\n"; if ( $str[1] =~ m/$hash{$sic}{BUS}/){ $str[38] = $hash{$sic}{CAT}; $str[39] = $sic; print "Found one. Bus name is $str[1] and cat is " . $hash{$sic}{CAT} . " and sic is " . $str[39] ."\n\n\n"; } }

output:
str1 = 'Domino''s Pizza' sic= 5812, cat= Pizza restaurants bus= Pizza Found one. Bus name is 'Domino''s Pizza' and cat is Pizza restaurants + and sic is 5812

Have a great weekend :)
Kevin