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

Re: memory issues reading large files

Thread Previous | Thread Next
From:
Brian Hayes
Date:
February 7, 2002 13:49
Subject:
Re: memory issues reading large files
Message ID:
20020207135142.A2617@redhouse.ucsc.edu
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,
Brian

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About