in reply to How do I search for every occurrence of strings within an array and display them?
Note the definition of a "word": any sequence of non-space characters that start and end with a letter. This is far from perfect.use 5.010; use strict; use warnings; use autodie; open my $kwh, "keywords.txt"; while (<$kwh>) { chomp; $keyword{$_}++ for split /,/; } close $kwh; open my $fh, "Skypelogs.txt"; while (<$fh>) { print if grep {$keywords{$_}} /(\pL(?:\S*\pL)?)/g; } close $fh;
|
|---|