Because you can only have one $_. But if I understand what you want to do you can try this:
open(KEYWORDS,"/tmp/file1") or die "cannot open /tmp/file1: $!"; my %keywords= map { ($_, 1) } <KEYWORDS>; # create a hash keyword => +1 open(STUFF_TO_MATCH,"/tmp/file2"); or die "cannot open /tmp/file2: $!"; while(<STUFF_TO_MATCH>) { print "$_ matched!\n" if($keyword{$_}); }
In reply to Re: Double While!
by mirod
in thread Double While!
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |