in reply to log parsing very slow
If you have one mask, Perl knows the regex hasn't changed, so it won't recompile - hence you will compile only one regex, despite your 100,000 lines of code.
You can do two things - either switch the order of the loops , that is, for each mask, create a regex, then loop over the log file (first seeking back to the start of the file!), or create an array of compiled regular expressions, and loop over them.
|
---|