> Don't do that.  The foreach reads the whole file into memory and then
> walks it line by line.  If we just want one at a time, let's fetch them
> that way

I don't agree with this. If you are working with a file that is as small as
the one included seems to be easier to just load up some data structures. I
understand writing efficient code is always best but for a quickie script
like this I wouldn't be to concerned with the 1/100th of a ms that your
going to shave off but not dumping the contents to memory. 

My 2 cents,
Paul Kraus
  


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to