use List::MoreUtils; if (any { $variable == $_ } (1, 2, 3)) { ... }
With the disadvantage of using an extra module, but with the advantage of not testing every single value after the first successful one (if the list is big, it's probably a better alternative).
In reply to Re: Using IF and OR, I'm sure there is a better way
by cog
in thread Using IF and OR, I'm sure there is a better way
by cosmicperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |