c:\@Work\Perl>perl -wMstrict -le "my @allwords = qw(this is a list of words that is required for tests); my @required = qw(this is a list of words that is required); ;; my %hash = map { $_ => 1 } @allwords; ;; print 'do stuff' if @required == grep { defined $_ } @hash{@required}; ;; my @notthere = qw(this list is not there in allwords); ;; print 'do not do stuff' unless @notthere == grep { defined $_ } @hash{@notthere}; " do stuff do not do stuff