![]() |
|
good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
open, sleep, & print together cause an errorby zeno (Friar) |
on Feb 10, 2001 at 04:03 UTC ( #57525=perlquestion: print w/replies, xml ) | Need Help?? |
zeno has asked for the wisdom of the Perl Monks concerning the following question: I have a program which loops indefinitely, and every 30 seconds checks for a condition and prints to a log file if the condition exists. But this distilled version of the code does not print out to the logfile:
As noted, if I comment out the sleep(30) line, the code writes out to the logfile while the program is running. I also noted that if if I modify the code so it closes the logfile, it does write to the logfile:
But it seems to me that the first example ought to work. Any ideas of why this happens? I'm using Perl 5.6, and this happens from both my Linux machine and from ActiveState Perl 5.60. BTW, I can think of other ways to do this, I'm mostly curious as to what causes it not to work. Thanks. -zeno
Back to
Seekers of Perl Wisdom
|
|