imlepid has asked for the wisdom of the Perl Monks concerning the following question:
it outputs "Hello..." at 5 second intervals. where as this:do { sleep(5); printf "Hello...\n"; } while(1);
displays nothing and just hangs until I hit C-c. Why will the first one display "Hello..." while the second without "\n" not? It must have to do with sleep because if I remove it both will be displayed ad infinitum.do { sleep(5); print "Hello..."; } while(1);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Troubles with do...while loop and sleep
by ikegami (Patriarch) on May 26, 2008 at 05:14 UTC | |
Re: Troubles with do...while loop and sleep
by runrig (Abbot) on May 26, 2008 at 04:10 UTC | |
Re: Troubles with do...while loop and sleep (line- vs. block-buffered)
by almut (Canon) on May 26, 2008 at 05:39 UTC | |
Re: Troubles with do...while loop and sleep
by ABuiteman (Initiate) on May 27, 2008 at 14:17 UTC |