in reply to Is there a way to control when output gets printed to a file?

How do I flush/unbuffer an output filehandle? Why must I do this?
And 'perldoc -q buffer' would've told you the same thing :-)

However, it is the opinion of some that you should explicitly open and close the log file on every print (or group of prints) so that you can rotate/move or (accidentally?) delete the log file while the program is running, and not lose any further output and have output continue to go to a file with the same name. And if it doesn't spend most of its time making log entries, it won't slow anything down significantly.

  • Comment on Re: Is there a way to control when output gets printed to a file?