In this situation i'd investigate whether regexes are even required. I bet the following is faster:
my %skip=map {$_=>1} qw(CPXX1 KLXX1 KMXX1 MEXX1 PAXX1 PMXX1 SLXX1 SZXX +1 WXXX1 YZXX1); while ( <IFILE>) { print OFILE unless $skip{substr($_,0,5)}; }
In reply to Re: perl performance vs egrep (why regex in this example?)
by demerphq
in thread perl performance vs egrep
by dba
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |