in reply to Daemon problem with sleep()
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)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Daemon problem with sleep()
by MichaelMeyer (Novice) on Dec 17, 2008 at 12:38 UTC | |
by targetsmart (Curate) on Dec 17, 2008 at 14:28 UTC |