If precompiling the regex makes such a big difference, you might consider trying eliminating your inner loop over the regexes by combining them into a single regex.
What if any difference it would make will depend on how close to IO bound you are, but starting the regex engine multiple times for each line is relatively expensive. Combining the regex so they capture the matched string and then using the captured text to look up the appropriate filehandle might achieve some savings.
In reply to Re^7: Splitting Apache Log Files
by BrowserUk
in thread Splitting Apache Log Files
by cmm7825
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |