in reply to matching elements in a list in a logical OR fashion
use strict; use Regexp::Match::Any; my @array = qw(Foo Bar Baz); my $bigstring = 'whatever'; if($bigstring =~ match_any(\@array)){ print "It matched\n"; }else{ print "It didn't match\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: matching elements in a list in a logical OR fashion
by Anonymous Monk on Jun 15, 2004 at 04:04 UTC |