It might be just a buffering problem. Are you sure you have waited long enough for the IO buffer (typically around 4k) to fill up?
Try flushing:
use IO::Handle; ... while (1) { print LOG "before sleep..."; LOG->flush(); sleep(1); print LOG "after sleep..."; }
(Also see Re: Troubles with do...while loop and sleep (line- vs. block-buffered) — or the classic "Suffering from Buffering")
(Update: moved LOG->flush() before the sleep — thanks ikegami)
In reply to Re: Daemon problem with sleep()
by almut
in thread Daemon problem with sleep()
by MichaelMeyer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |