P is for Practical | |
PerlMonks |
Re: Matching lines in 2+ GB logfiles.by mscharrer (Hermit) |
on May 01, 2008 at 16:02 UTC ( [id://683957]=note: print w/replies, xml ) | Need Help?? |
The reason for the slow execution is most likely the use of the two .* in the regex which result in a very high number of checks inside the regex machine. This is difficult to explain as long you don't know what backtracking is and how it works. For now just try this:
Precompiling $re using qr{} is recommended, or use the o option.
In Section
Seekers of Perl Wisdom
|
|