If you're searching for an exact match you might as well use a hash:
I suppose you extracted the code from your script and that's why you have a return outside of a function?my $commonWords = {}; # Make commonWords a ref to an empty hash ... while (my $line = <>) { chomp($line); $commonWords->{$line} = 1; } ... if ($CkDiscardCommonwords eq 1) { return(0) if exists $commonWords->{$term}; }
In reply to Re: Filtering out stop words
by Eily
in thread Filtering out stop words
by IB2017
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |