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

Hello: I would like to insert a wait (15 minute)into a perl program. Can you suggest any examples? The routine needs to check a database for current data...if the data has not yet arrived then wait 15 minutes and then try again. Thanks

Replies are listed 'Best First'.
Re: Perl Wait
by suaveant (Parson) on Apr 24, 2001 at 21:25 UTC
    sleep number_of_seconds;

    so sleep 60*15; would be a 15 minute 'wait'
                    - Ant

Re: Perl Wait - Unperl solution
by TGI (Parson) on Apr 24, 2001 at 22:12 UTC
    Consider cron for this. Your crontab entry will look something like this:
    # Check database every 15 minutes # Minute Hour Day of Month Month Day of Week Cmd */15 * * * * dbck >> /var/log/dbck


    TGI says moo

Re: Perl Wait
by LordAvatar (Acolyte) on Apr 25, 2001 at 00:43 UTC
     Try sleep 60*15 or sleep 900

    -LordAvatar