if( $input =~ /$first/i ){ ... } #### # prompt for $filename open HINTS, "Hints.txt" or die "Can't find file\n"; while( my $hintline = ){ my ($first,$last) = split(/\ == /,$hints); my $results = `strings $filename | grep -i '$first'`; next unless length $results; printf "Found: %s\n", $last; } close HINTS;