Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Pel script within perl script

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

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

Hi,

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.

    Vivek
    -- 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 leslie (Pilgrim) on Mar 04, 2009 at 13:43 UTC

    Instead of using module you can use sleep function like in the below code.

    a.pl ----- use strict; use warnings; print "hello\n"; b.pl ---- use strict; use warnings; while(1) { system("perl ./a.pl"); sleep(1) }

    Each and every 1 second a.pl 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 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 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 perlfilename.pl`; (or) system("perl perlfilename.pl");
    A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (1)
As of 2024-04-25 00:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found