Roust has asked for the wisdom of the Perl Monks concerning the following question:

Well, there is a first time for everything... and here is my first q in this forum. I have written a script which filters a mailinglist and it all works fine. My problem is, I have to run the script manually every time I want to filter the incomming mails. I have tried to write a second script to call the filter where I used a code like this to do so << while( 1 ){ //Call script sleep( 60 ); } And it worked fine, but it crashes after a couple of hours, and I need it to run like every second hour or so, also during the night. My question is, how can I write a code that can run during the day and call a second script every now and then with out crashing? It has to be stable since it has to run during the weekend as well? I need something stable to run on my windows machine since I don't have a server!!

Replies are listed 'Best First'.
Re: Running timed routines in Perl
by broquaint (Abbot) on Oct 28, 2002 at 12:27 UTC
    For scheduling processes in Windows check out the cron on Windows node which provides several handy solutions.
    HTH

    _________
    broquaint

Re: Running timed routines in Perl
by husoft (Monk) on Oct 28, 2002 at 12:29 UTC
    There's no need to write a second script to call the filter,
    use the Windows Scheduled Tasks.

    You can use it from your Command Prompt like this:
    c:\>at <when> /interactive what-to-run, or simply going to
    your control panel and clicking, Scheduled Tasks

    Hope this helps.
Re: Running timed routines in Perl
by AcidHawk (Vicar) on Oct 28, 2002 at 12:53 UTC

    Well, I think we need a little more info about what microsoft os you are running on your server.

    Have you looked at AT the scheduler for win32 systems...
    you may also want to have a look at writing your script as a win32 service by using Win32::Daemon found at Roth's web site

    -----
    Of all the things I've lost in my life, its my mind I miss the most.