Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

RE: RE: Re: read X number of lines?

by takshaka (Friar)
on May 26, 2000 at 10:59 UTC ( [id://14929]=note: print w/replies, xml ) Need Help??


in reply to RE: Re: read X number of lines?
in thread read X number of lines?

You can even squeeze a little more out. This is ~5% faster on my system.
my($buf, $chunk, @lines); while(read FILE, $buf, BUFFER_SIZE) { $chunk .= $buf; @lines = split /\n/, $chunk; $chunk = chomp $buf ? '' : pop @lines; foreach (@lines) {} }
(BUFFER_SIZE is just a constant I was using)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://14929]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-19 05:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found