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

hi all,

i have several perl scripts. how do i run all those perl scripts at a time. ie., if i run one master script, that should run all the scripts.

thanks
rsennat

Replies are listed 'Best First'.
Re: several perl scripts
by secret (Beadle) on Dec 23, 2005 at 17:39 UTC

    You can write a shell script that launches all the perl scripts like you would do from the command line ( use & at the end of each perl script call).

    You can write a perl script that forks out to the shell ( with the exec command) and call the perl scripts.

    All this will launch them sequencially, that is "almost" at the same time.

    You could also program them all to launch at the same time in the crontab but that's probably not what you want.

Re: several perl scripts
by Joost (Canon) on Dec 23, 2005 at 23:44 UTC
Re: several perl scripts
by rashley (Scribe) on Dec 23, 2005 at 17:45 UTC
    Yep, a shell script is the easiest way to do this.

    But if you want them to run simultaniously, you'll have to multithread your perl script and use exec to call one script in each thread.