Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: temp hold logfiles in memory?

by Eliya (Vicar)
on Mar 19, 2011 at 16:14 UTC ( [id://894161]=note: print w/replies, xml ) Need Help??


in reply to temp hold logfiles in memory?

Writing to a file handle is by default buffered anyway (i.e. unless it's unbuffered (autoflushed) or line-buffered (interactive/terminal)) .  As the buffer size is 4k, it doesn't seem to make much sense to do additional buffering yourself at 1k granularity (though maybe that's not the real value you finally intend to use...).

If you want a larger buffer (the 4k cannot be changed without recompiling perl), maybe you could open the log file handle to a scalar, and periodically check its size...

open(my $outfh, '>', \$buf)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2024-04-19 08:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found