develooper Front page | perl.beginners | Postings from February 2002

Re: memory issues reading large files

Thread Previous | Thread Next
Brian Hayes
February 7, 2002 13:49
Re: memory issues reading large files
Message ID:
It appears the problem was using the foreach statement instead of while.
I have not tested this extensively, but using foreach the whole text
file (or output of pipe) is read into memory before continuing, but
using while (and probably for) each line is processed as it is read.  

Thanks for all your help,

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About