Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: How to automatically execute a perl file....

by bastard (Hermit)
on Jul 26, 2001 at 06:46 UTC ( [id://99878]=note: print w/replies, xml ) Need Help??


in reply to How to automatically execute a perl file....

Well the first two answers are not perl based.

On a unix system you should probably use cron.

On a windows machine something like Norton Scheduler should work.

The basic way to do this in perl is thus:

while (1) { <place code here> sleep(86400); }
Let it run in the background. It will sleep for 24 hrs (86400 seconds) then repeat the loop.
This may have some problems (a day is not exactly 24 hrs).

Another way to do it is to sleep for a lesser interval and do a check for the time passing then execute whatever code is needed.

I would reccommend looking into a separate scheduling agent though. Thats what they do best.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-23 06:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found