in reply to How can I use a text file as a search string?
The <> of course implies STDIN, so you'd have to redirect or pipe the contents of *.txt into the script at the commandline.my @names_to_check = qw/ bob sue joe /; my %validnames = (); # build lookup while(<>) { chomp; $validnames{$_}++; # also filters dups in *.txt } # check names for (@names_to_check) { print "$_ is okay\n" if (exists($validnames{$_})); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How can I use a text file as a search string?
by btobin0 (Acolyte) on Dec 06, 2007 at 06:30 UTC |