if ( $item1 eq $item3 or $item2 eq $item3 ) { ... } #### use Quantum::Superpositions; if ($item3 eq any($item1, $item2)) { ... }