in reply to Re: matching elements in a list in a logical OR fashion
in thread matching elements in a list in a logical OR fashion

This might be even faster, depending on what's in @array...
Regex::Presuf works wonders, and /o usually helps too.

use strict; use Regex::PreSuf; my @array = qw( foo bar baz ); my $re = presuf(@array); my $bigstring = 'whatever'; if ($bigstring =~ /$re/o) { print "it matched"; }