my %stopwords; @stopwords{(qw(a i at be do to or is not no the that they then these them who where why can find on an of and it by))} = 1 x 27; #### my @salient_word = grep { not $stopwords{$_} } @word ; #### use Set::Scalar; $stopwords = Set::Scalar->new; $stopwords->insert( qw(a i at be do to or is not no the that they then these them who where why can find on an of and it by)); @word = split /\s+/, "Oh say can you see by the dawn's early light"; #### my @salient_word = grep { not $stopwords->has($_) } @word ; #### $word = Set::Scalar->new(@word); my $salient_word = $word - $stopwords; # or this: my $salient_word = $word->difference($stopwords); #### $members = Set::Scalar->new(@members); my $not_in = $s - $members; my $in = $s->intersect($members); $s->delete($in->members); $s->insert($not_in->members); #### $N = ($a - $b); $N->insert($b - $a);