![]() |
|
Perl: the Markov chain saw | |
PerlMonks |
Re: Safely reading line by lineby cdarke (Prior) |
on Jun 27, 2007 at 12:59 UTC ( #623609=note: print w/replies, xml ) | Need Help?? |
You could just read one char at a time, looking for a newline to terminate the line. You can use read for that, or local $/=\1;. Assuming you have not switched buffering off, the data will not be transferred from the disc one char at a time, only from the buffer. It is then easy to impose a limit for a line length.
In Section
Seekers of Perl Wisdom
|
|