![]() |
|
Think about Loose Coupling | |
PerlMonks |
matching elements in a list in a logical OR fashionby Anonymous Monk |
on Jun 15, 2004 at 03:40 UTC ( #366756=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I searched for this, but I could not, for the life of me, think of a concise way to do it, and thus get an answer without asking.
Lets say I have: @array(foo, bar, baz). and I want to match those items in an or fashion. thusly: if($bigstring =~ /(foo|bar|baz)/i){blah} except instead of typing out foo, bar, and baz I would just hit the array instead. Any hints?
Back to
Seekers of Perl Wisdom
|
|