Nathan Torkington wrote:
> > +   while (<FILE>) {
> > +      # ...
> > +   }
> > +
> > +instead of this:
> > +
> > +   @data = <FILE>;
> > +   foreach (@data) {
> > +       # ...
> > +   }
> > +
> > +When the files you're processing are small, it doesn't much matter which
> > +way you do it, but it makes a huge difference when they start getting
> > +larger. The latter method keeps eating up more and more memory, while
> > +the former method scales to files of any size.
> 
> I think you've got 'latter' and 'former' the wrong way around here.

I don't think so, Nat.  What he's saying is that the latter method
uses an amount of memory related to the size of the file, while
the former method doesn't (in general).

-- 
John Porter

Reply via email to