or of course writeif (grep { $_ eq $item3 } ($item1, $item2)) { #do something }
if ($item1 eq $item3 or $item2 eq $item3) { ... }
-- Hofmator
Code written by Hofmator and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
In reply to Re: testing more than one item for equality
by Hofmator
in thread testing more than one item for equality
by jonnyfolk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |