use warnings; use strict; use List::Compare; my @allwords = qw( mary had a little lamb its fleece was white as snow ); my @checkwords1 = qw( little lamb fleece everywhere ); my @checkwords2 = qw( little lamb fleece ); my $lc1 = List::Compare->new(\@allwords, \@checkwords1); my $lc2 = List::Compare->new(\@allwords, \@checkwords2); ## See if the list on the Right, @checkwords, ## is a subset of the list on the left, @allwords. print "Check 1: All words were ", $lc1->is_RsubsetL ? "" : "not ", "found.\n"; print "Check 2: All words were ", $lc2->is_RsubsetL ? "" : "not ", "found.\n"; __END__ Check 1: All words were not found. Check 2: All words were found.