in reply to RE: Re: read X number of lines?
in thread read X number of lines?
(BUFFER_SIZE is just a constant I was using)my($buf, $chunk, @lines); while(read FILE, $buf, BUFFER_SIZE) { $chunk .= $buf; @lines = split /\n/, $chunk; $chunk = chomp $buf ? '' : pop @lines; foreach (@lines) {} }
|
|---|