![]() |
|
Perl-Sensitive Sunglasses | |
PerlMonks |
Re: OR sequence (ARRAY ~~ /PATTERN/)by lodin (Hermit) |
on Mar 21, 2008 at 22:58 UTC ( #675549=note: print w/replies, xml ) | Need Help?? |
One way of doing it is In Perl 5.10 that can be written as which is pretty close to how you tried to write it. The latter is also slightly more efficient for large lists, as it stop to look in the list as soon as it finds a match, in contrast to grep which searches the whole list. lodin
In Section
Seekers of Perl Wisdom
|
|