#!/usr/bin/perl use strict; use Lingua::StopWords qw( getStopWords ); my $stopwords = getStopWords('en'); my $text='I want to remove stop words'; #my @words = qw ($text); print join ' ', grep { !$stopwords->{$_} } $words;