Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: printing to filehandles

by Roger (Parson)
on Sep 02, 2005 at 10:54 UTC ( #488610=note: print w/ replies, xml ) Need Help??

in reply to printing to filehandles

You have to flush your file handle after printing to write to the disk immediately, otherwise it gets conveniently buffered in memory.

use FileHandle; ... open OUT, ...; autoflush OUT 1; print OUT ...;

The alternative is to close the file after you have finished reading, and open it again next time before writing to it. Keep the time that the file is openned as short as possible.

Comment on Re: printing to filehandles
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2015-10-14 02:41 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (320 votes), past polls