my $word="of"; my @stopwords= ("a","the","of"); if (grep /$word/i, @stopwords) { print "Stopword $word discarded\n"; } else{ print "$word is not a stop word\n"; }