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


I want a perl script that periodically can call other perl scripts.

Can this be acheived thru any CPAN module.

Replies are listed 'Best First'.
Re: Pel script within perl script
by targetsmart (Curate) on Mar 04, 2009 at 10:13 UTC
    If only periodic call is the priority
    In case you are using unix based OS, you can check for crontab command, that will be a better approach. You can set up crontab and the cron daemon will run your perl programs at periodic intervals.

    -- In accordance with the prarabdha of each, the One whose function it is to ordain makes each to act. What will not happen will never happen, whatever effort one may put forth. And what will happen will not fail to happen, however much one may seek to prevent it. This is certain. The part of wisdom therefore is to stay quiet.
Re: Pel script within perl script
by Bloodnok (Vicar) on Mar 04, 2009 at 11:27 UTC
    As has been suggested in response to a number of recent similar SoPW nodes, have you considered Schedule::Cron ??

    A user level that continues to overstate my experience :-))
Re: Pel script within perl script
by leslie (Pilgrim) on Mar 04, 2009 at 13:43 UTC

    Instead of using module you can use sleep function like in the below code. ----- use strict; use warnings; print "hello\n"; ---- use strict; use warnings; while(1) { system("perl ./"); sleep(1) }

    Each and every 1 second code will get call. We can also use alarm signal for achieve this. After alarm signal is occur we can call the appropriate perl script. Then we can re-assign the alarm.

Re: Pel script within perl script
by Anonymous Monk on Mar 04, 2009 at 10:12 UTC
    hi, Through perl system command you can able to execute a perl script with in a perl programming. eg:
    print `perl`; (or) system("perl");
    A reply falls below the community's threshold of quality. You may see it by logging in.