Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2014-12-25 18:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (162 votes), past polls