while (1) { if (-f $fn) { ## a file was found, do something DoSomething(); ## then exit exit; } ## pause 5 minutes before checking again sleep 300; }
really be:
while (1) { if (-f $fn) { ## a file was found, do something DoSomething(); ## then break the loop break; ## <<-- not exit(); } ## pause 5 minutes before checking again sleep 300; }
In reply to Re: Re: perl daemon
by eLore
in thread perl daemon
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |