becca23 has asked for the wisdom of the Perl Monks concerning the following question:
However, the sleep function has become a terrible labryinth of problems to my script and I would like to find a more efficient way to run my script continually than with a while loop and a sleep function. Any suggestions? Oh and this is on a Win32 platform. This is what the script does essentially. It automates an rsync backup of files betwen two servers every two minutes. The problem I was having with sleep is that it delays any print/output file statements until after the sleep has executed, and this often resulted in output files getting truncated. for example if i did this:while() { ...code... sleep(120); }
The script would wait two minutes before printing out hello. Very strange problem and i don't know how to fix it, maybe you guys do?print "hello"; sleep(120);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A continually running process
by Fletch (Bishop) on Jun 25, 2008 at 20:54 UTC | |
by monarch (Priest) on Jun 25, 2008 at 21:09 UTC | |
by becca23 (Novice) on Jun 25, 2008 at 21:26 UTC | |
|
Re: A continually running process
by jettero (Monsignor) on Jun 25, 2008 at 20:16 UTC | |
|
Re: A continually running process
by psini (Deacon) on Jun 25, 2008 at 20:22 UTC | |
|
Re: A continually running process
by GrandFather (Saint) on Jun 25, 2008 at 21:05 UTC | |
|
Re: A continually running process
by zentara (Cardinal) on Jun 26, 2008 at 11:35 UTC | |
by BrowserUk (Patriarch) on Jun 26, 2008 at 13:28 UTC | |
by zentara (Cardinal) on Jun 26, 2008 at 18:22 UTC |