Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Think about Loose Coupling
 
PerlMonks  

Re: Buffering File Output

by clintp (Curate)
on Jan 23, 2002 at 04:56 UTC ( #140774=note: print w/ replies, xml ) Need Help??


in reply to Buffering File Output

Do something like this once, after opening the output filehandle:

select(OUTPUT); # Change the default filehandle $|=1; # Turn on autoflushing for default f.h. select(STDOUT); # Go back to normal default f.h.
More importantly:

When processes exit normally (via the exit function or simply falling off the end of the script) pending output on filehandles is flushed and the filehandles are closed. What's curious is that this isn't happening for you. Are you terminating the script in some odd way? Segfaulting it? Killing it with a signal?


Comment on Re: Buffering File Output
Select or Download Code
Re: Re: Buffering File Output
by MadraghRua (Vicar) on Jan 23, 2002 at 05:05 UTC
    Thanks for the reply. No, nothing is used to terminate the script. What finishes the script is the end of file marker in the input file. So when the script finishes running, all the records are printed to screen and about 200 lines are not printed to the output file.

    MadraghRua
    yet another biologist hacking perl....

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2014-04-18 12:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (466 votes), past polls