OUTER: foreach my $item (@array){ foreach my $subitem (@array2){ next OUTER if($subitem eq $item); } }