Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Pel script within perl script

by palette (Scribe)
on Mar 04, 2009 at 10:07 UTC ( #748062=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://748062]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2023-06-10 07:00 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (37 votes). Check out past polls.