in reply to regex return true instead of false
The difference between your first and second examples is that you've swapped out the || for && operators. If you hadn't done that, it works - unless (condition) {code} is equivalent to if (condition) {} else {code} and if ( not (condition) ) {code}, but there is no change to condition needed.
In the third example, due to operator precedence, !$var =~ /regex/ is equivalent to (!$var) =~ /regex/. Although you could use parentheses, the better way to write that is $var !~ /regex/. Also, you need to swap the unless for an if, since the question you're asking is "if $args doesn't contain this thing, and $args doesn't contain this other thing", not the opposite of this condition.
Update: Tested some more, and added the last sentence.
|
|---|