in reply to Re: How do you read the next line in a file while in a loop?
in thread How do you read the next line in a file while in a loop?

Thanks, traveler. I maybe missing something but I don't I want to load a file that could be 50 MB into a string. Am I thinking incorrectly here?
  • Comment on Re: Re: How do you read the next line in a file while in a loop?

Replies are listed 'Best First'.
Re: Re: Re: How do you read the next line in a file while in a loop?
by traveler (Parson) on Aug 31, 2001 at 02:55 UTC
    You are not reading the entire file. <> reads a line at a time just as it does in your while. (Perhaps that is why it is called the "line input operator" <grin>) In array context it can read the entire file into an array, but in scalar context it reads a line. It looked as though your file was multiple lines (based on seeing your while and your wished-for readln). If it is, then this should work.

    HTH, --traveler