In fact I've had to workaround:if ( ($item1 or $item2) eq ($item3) ) { #do something; }
Is there a more direct statement one can use?my $result = grep { $_ eq $item3 } ($item1, $item2); if ($result) { #do something }
In reply to testing more than one item for equality by jonnyfolk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |