Help for this page
open( LIST, "mystopwords.txt" ) or die "$!"; my @stopwords = <LIST>; # assuming one stop word per line ... s/\b(?:$stopregex)\b//g;
my %stopwd; open( LIST, "my_stopwords.txt" ) or die "$!"; ... my $filtered = join '', map { exists($stopwd{$_}) ? '':$_ } split /\b/ +;