|There's more than one way to do things|
Flushing the print buffers.by kansaschuck (Sexton)
|on Feb 21, 2008 at 19:48 UTC||Need Help??|
kansaschuck has asked for the
wisdom of the Perl Monks concerning the following question:
I've been loving Perl and coding away. I've got a fairly cool monitoring program now running on my PC with the ActiveState. 5.10 Windows XP.
But after chasing some loop problems I find the issue is that the print buffers aren't clearing. For example a "print" command to notify me that I've entered a 60 second sleep coded just before sleep later appears on the windows command prompt screen after sleep is exited. hmmmm My first fight with Perl. And I was begin to love you as much as PHP :-).
So it's off searching for a good clean way to clear the buffers. Doesn't seem to be a universal way to do it. And why do I have to do it any way?
printsometime "better late than never";I tried
# print buffers to insure messages go to screen quickly
Two things, 1) Don't really understand that code and 2) what the heck it didn't work away way
Also saw the flush(3) code mentioned here by a monk.advice, pointer, suggestion
p.s. I still love Perl.