Or:

use Proc::Background;

my $x = Proc::Background->new("perl attachment.pl"); # Or correct args to
launch script
$x->wait(); # Wait for process to exit.  More methods available.
my $z = Proc::Background->new("perl attachmentN.pl");
$z->wait();
...

On Thu, Dec 1, 2011 at 1:25 PM, Shlomi Fish <shlo...@shlomifish.org> wrote:

> Hi Ryan,
>
> On Thu, 01 Dec 2011 12:38:56 -0500
> "Ryan.Barracuda" <ryan.barrac...@elboardo.com> wrote:
>
> > Hi all,
> >
> > I have 7 perl scripts that I want to run simultaneously from the command
> > line with the possibility of growing this number. I'm pretty new to
> perl, so
> > thought in the mean time it would be a good idea to create a perl script
> to
> > run multiple scripts. I could just add to this file as needed if more
> > scripts are created. What is the best way to do this? I have the
> following
> > scripts that I want to fire off all at once.
> >
> > attachment.pl
> > attachment2.pl
> > attachment3.pl
> > attachment4.pl
> > attachment5.pl
> > attachment6.pl
> > attachment7.pl
> >
> > I would like to fire these all off from a script called automated.pl.
> >
>
> One option would be to use http://perldoc.perl.org/functions/fork.html in
> a
> loop and execute 7 children to do that. Another option is to use GNU make
> or a
> similar parallel-building tool, and to then use "make -j" to run
> everything as
> once. See:
>
> http://www.gnu.org/s/make/
>
> Regards,
>
>        Shlomi Fish
>
>
> --
> -----------------------------------------------------------------
> Shlomi Fish       http://www.shlomifish.org/
> Parody of "The Fountainhead" - http://shlom.in/towtf
>
> Larry Wall has been changing the world. By modifying its very source code.
>
> Please reply to list if it's a mailing list post - http://shlom.in/reply .
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>

Reply via email to