#!/usr/bin/perl -w use strict; my @test_a = qw (a b c d e); my @test_b = qw (a b c d e); my @test_c = qw (a b c d f); my %standard = map{$_ => 1}@test_a; if (grep{!$standard{$_}}@test_b) { print "FAIL test_b .. not all b in a\n"; } else { print "PASS test_b .. all b in a\n"; } if (grep{!$standard{$_}}@test_c) { print "FAIL test_c .. not all c in a\n"; } else { print "PASS test_c .. all c in a\n"; } __END__ PRINTS: PASS test_b .. all b in a FAIL test_c .. not all c in a