my @array1 = ...; my @array2 = ...; my %hash; @hash{@array1} = (); delete @hash{@array2}; die "Failure" if %hash; print "Success";