in reply to perl performance vs egrep

...and, of course, since your regular expression remains constant throughout your runtime, you can append an 'o' to whatever regex you wind up using...
print OFILE unless /^$some_regex/o;
...which should speed things up a bit.

Replies are listed 'Best First'.
Re^2: perl performance vs egrep
by Aristotle (Chancellor) on Jan 24, 2005 at 03:55 UTC

    That does nothing in this case since there are no variables in the regex; and without understanding what it does, you can easily cause bugs by using it when there are variables. Don't use /o, use qr//.

    Makeshifts last the longest.

      Be damned; been misreading perlop all this time. I sit corrected, and so forth; thanks. =)