in reply to Using IF and OR, I'm sure there is a better way
sub in_list { my $needle = shift || q{}; # or croak, your choice. croak 'expecting haystack' if not @_; return grep m/^$needle$/, @_; } if (in_list($var, qw(A B C))) { ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using IF and OR, I'm sure there is a better way
by eff_i_g (Curate) on Dec 15, 2005 at 00:27 UTC |