Make sure you put the most common codes at the front of your @codes array for more speed, since you'll do less searching.my @codes = qw/ CODE1 CODE2 CODE3 /; my @regex = map { qr/$_/i } @codes; while (my $inputline = <FILE>) { my $found = 0; foreach my $regex (@regex) { last if ($found) = $inputline =~ /($regex)/); } next unless $found; # logic goes here }
--
perl -e "print qq/just another perl hacker who doesn't grok japh\n/"
simeon2000|http://holdren.net/
In reply to Re: Bulk Regex?
by simeon2000
in thread Bulk Regex?
by meetraz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |