Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Filtering Source Text File with 2nd Text File of Termsby vitoco (Hermit) |
on Apr 03, 2012 at 17:53 UTC ( [id://963286]=note: print w/replies, xml ) | Need Help?? |
Please note that unescaped special characters in strings used as patterns could give unpredictable results!!! Example: the term "www.thisisannoying.com" will also match lines with "wwwithisisannoyingacom"... If the terms from the list are single words, probably the test from previous posts should be: print "$source\n" unless grep { $source =~ /\b$_\b/ } @terms;where \b is used to check for word boundaries, so "googleeee" won't be matched by "google" term.
In Section
Seekers of Perl Wisdom
|
|