jonnyfolk has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to do the following:
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 }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: testing more than one item for equality
by davorg (Chancellor) on Oct 18, 2006 at 11:36 UTC | |
Re: testing more than one item for equality
by Hofmator (Curate) on Oct 18, 2006 at 11:40 UTC | |
Re: testing more than one item for equality
by fenLisesi (Priest) on Oct 18, 2006 at 11:43 UTC | |
Re: testing more than one item for equality
by Melly (Chaplain) on Oct 18, 2006 at 11:58 UTC | |
Re: testing more than one item for equality
by davido (Cardinal) on Oct 18, 2006 at 15:52 UTC | |
Re: testing more than one item for equality
by blazar (Canon) on Oct 18, 2006 at 12:10 UTC | |
Re: testing more than one item for equality
by Velaki (Chaplain) on Oct 18, 2006 at 11:50 UTC | |
by blazar (Canon) on Oct 18, 2006 at 13:09 UTC | |
by Velaki (Chaplain) on Oct 18, 2006 at 13:17 UTC |
Back to
Seekers of Perl Wisdom