in reply to Perl Timer

It sounds like the only reason to have it running continuously is to sleep, which means you're looking at the problem from the wrong angle. You need to rely on the OS to schedule execution at a particular date/time. What you're looking for is either cron under *nix, or the Task Scheduler under Windows NT/2000/XP.

Replies are listed 'Best First'.
Re: Re: Perl Timer
by The_Rev (Acolyte) on Dec 18, 2002 at 21:54 UTC
    Well, not to through another wrench into the mix, but it may have to be run once every hour for a 24 hour period ... hmmm ... maybe I should look at the Task Scheduler in Win32.

    Thanks

      I agree with your comment and would definitely recommend you wrap your script into a batch file either via pl2bat or by handrolling a batch file to interact with your program. Then whack it into task scheduler.

      I've found this to be the best way on win32 (for me at least). On the win2k environments I work with I can also allow my programs to run as particular users. You could use the runas command to replicate this (assuming your windows platform supports it).

      ie:
      C:\>runas RUNAS USAGE: RUNAS [/profile] [/env] [/netonly] /user:<UserName> program /profile if the user's profile needs to be loaded /env to use current environment instead of user's. /netonly use if the credentials specified are for remote acc +ess only. /user <UserName> should be in form USER@DOMAIN or DOMAIN\ +USER program command line for EXE. See below for examples


      Hope that helps :)