I suppose grep does the same like I suggested before, reading large chunks into memory and trying to match multiple lines at once.
Another option is to fork into four child's each processing a quarter to use the full power of your machine.
And btw using lexical variables declared with my should help a little too.
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
In reply to Re^3: How to optimize a regex on a large file read line by line ?
by LanX
in thread How to optimize a regex on a large file read line by line ?
by John FENDER
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |