Try changing your foreach loop to a while loop. The effect of that will be to read the file line-by-line instead of attempting to load the whole thing into memory before processing it.
In reply to Re: speeding up script that uses filehandles
by Yendor
in thread speeding up script that uses filehandles
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |