The qr// approach described in perlfaq6 (that is, versions of perlfaq6 that ship with Perl 5.005 or later, but not the one on this site) is much faster.
my @regexes = map { qr/\Q$_/ } @latin_am; while (<>) { for my $regex (@regexes) { if ($_ =~ $regex) { print; last; } } }
In reply to Re: matching an array of alternates
by takshaka
in thread matching an array of alternates
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |