if (grep {$_ eq $zero_arg} @ARRAY) and not grep {$_ eq $sec_arg} @anotherarray){ doSomething(); }