I have a list of possible values:
@a = qw(foo bar baz);
How do I check in a concise way that a value $val is present or absent
$val
If you don't like unnecessary dependency, implement any or first yourself
any
first
sub first (&@) { my $code = shift; $code->() and return $_ foreach @_; undef } sub any (&@) { my $code = shift; $code->() and return 1 foreach @_; undef }