Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Matching lines in 2+ GB logfiles.

by mscharrer (Hermit)
on May 01, 2008 at 16:02 UTC ( #683957=note: print w/replies, xml ) Need Help??

in reply to Matching lines in 2+ GB logfiles.

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:
while ( $window =~ m/\w{3}\s{1,2}\d{1,2}([^\n]+)\n/oigc && $1 =~ /$re/ +) { &$callback($1); }

Precompiling $re using qr{} is recommended, or use the o option.

Replies are listed 'Best First'.
Re^2: Matching lines in 2+ GB logfiles.
by dbmathis (Scribe) on May 01, 2008 at 17:10 UTC

    I could not get this to work. Would not match anything.

    After all this is over, all that will really have mattered is how we treated each other.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://683957]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2022-01-22 21:33 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (63 votes). Check out past polls.