in reply to Using IF and OR, I'm sure there is a better way
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).
|
|---|