Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://488610]
help
Chatterbox?
[holli]: hessenrap...
[holli]: love it :)
[Corion]: acapella hessian rap, but they also do melodic stuff, like Shout (Tears for Fears)

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (11)
As of 2017-11-18 19:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (277 votes). Check out past polls.

    Notices?