$word = Set::Scalar->new(@word); my $salient_word = $word - $stopwords; # or this: my $salient_word = $word->difference($stopwords);