The simplest approach is probably the clearest.
if ( $item1 eq $item3 or $item2 eq $item3 ) { ... }
Alternatively, there's always Quantum::Superpositions.
use Quantum::Superpositions; if ($item3 eq any($item1, $item2)) { ... }
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
In reply to Re: testing more than one item for equality
by davorg
in thread testing more than one item for equality
by jonnyfolk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |