Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Conditional idiom : "if X equals Y or Z" ??

by ferrency (Deacon)
on Jun 11, 2002 at 13:35 UTC ( #173466=note: print w/replies, xml ) Need Help??


in reply to Conditional idiom : "if X equals Y or Z" ??

You could also do away with the "if" altogether:

for (@tabs) { $_->{Suppress} ||= $_->{Action} =~ /^(GetAll|Make|MakeOnly)$/; }
This won't do the match if $_->{Suppress} is already set. And it will only set Suppress if it wasn't set before, and if the Action matches one of the three options. It's also short, though not the shortest possible solution.

Alan

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://173466]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2019-12-09 07:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?