It would seem you are going about this the hard way. Instead of breaking the sentences down into words you could combine the stopwords and make a regex.
Then you just use s/// to replace occurences of the stop words with nothing or a marker of some sort.
use strict; use warnings; my $text = "Hello world how are you doing?"; my @stopwords = ("hello","how"); my $regex = join('\b|\b', @stopwords); $text =~ s/$regex/*BAD*/igs; print $text;
In reply to Re: removing stopwords
by eric256
in thread removing stopwords
by zulqernain
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |