Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: Re: Infinte perl script

by Blue (Hermit)
on Jan 05, 2001 at 20:49 UTC ( [id://50098]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Infinte perl script
in thread Infinte perl script

How long to sleep depends on the granularity of what you need. If the file gets deleted and you need to do something immediately, then a small sleep. If you just generally need to know it, perhaps a sleep 300 or <code>sleep 600<code> for 5 or 10 minutes would be appropriate. If you need to do something by the next day, sleep for an hour or more, who cares.

However, if your delay is big, a better answer might be to use a scheduler to run you check program instead of idle in the background. On a *nix box use cron, not sure on Win32 box. This isn't as worthwhile with a small delay because of the overhead of loading Perl.

While this may not use much CPU resources, since you are doing I/O, it is also using disk resources. I'd set the delay as long as you can stand.

=Blue
...you might be eaten by a grue...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://50098]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-19 05:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found