When I first encountered unless in Perl I thought it was pretty cool. However in practise I'm much more used to plain ol' if and I find unless slows down comprehension of code so I hardly ever use unless. I never use negated expressions or expressions with more than one term with unless - that is just too mind bendy.
I'd be strongly inclined to refactor the OP's condition to be like the version I used just to make the code easier to understand and maintain. In my view it is almost always worth taking the time to simplify convoluted code. And yes, putting the alternates in the regex is a completely acceptable solution.
In reply to Re^9: regex return true instead of false (precedence)
by GrandFather
in thread regex return true instead of false
by ovedpo15
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |