in reply to Pimp My RegEx
I would have said the same thing that dragonchild pointed out, i.e. that since you are matching the beginning of a line, you can apply your regexp line by line.
However, I'll tell you something more that will save you 30 to 50% of execution time:
Remove "use English;" and change $INPUT_RECORD_SEPARATOR into $/. This will avoid the malicious influence of the so called evil variables ($`, $&, $').
I have actually benchmarked your script with a few hundred lines of logs, and this change saves about 40% of execution time on my laptop.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Pimp My RegEx
by heathen (Acolyte) on May 31, 2005 at 18:56 UTC | |
by jhourcle (Prior) on May 31, 2005 at 20:02 UTC | |
by heathen (Acolyte) on May 31, 2005 at 20:24 UTC | |
by radiantmatrix (Parson) on May 31, 2005 at 20:01 UTC | |
by eyepopslikeamosquito (Archbishop) on May 31, 2005 at 20:50 UTC |
In Section
Seekers of Perl Wisdom