Don't worry about performance just yet. Write something that is easy for you to maintain in case you change the list of alternatives.
my @alternatives = qw(a b etc); # add more by just typing them if (grep {$_ eq $var} @alternatives) {}
In reply to Re: long if statements... What's the best way?
by Narveson
in thread long if statements... What's the best way?
by cosmicperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |