There's more than one way to do things | |
PerlMonks |
Re: Testing multiple variables against the same criteria (IF statement)by BrowserUk (Patriarch) |
on Sep 05, 2016 at 17:57 UTC ( [id://1171210]=note: print w/replies, xml ) | Need Help?? |
You could do:
But that won't short-circuit -- ie. It will test all 4 variables every time -- and is really only beneficial if the vars are an array. You might consider List::MoreUtils::any() which will short-circuit. Personally, if there are only four variables and using an array doesn't work for you; I'd stick with your original statement. With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.
In Section
Seekers of Perl Wisdom
|
|