use it thus:sub is { bless \shift, '_hidden'; } sub _hidden::in { my $s=${shift,}; $s eq $_ and return 1 for @_; 0; }
do_something if is($item)->in(@list);
In reply to Re: looking for simple way to check scalar against array
by blazar
in thread looking for simple way to check scalar against array
by raflach
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |