in reply to Running perl scripts in parallel
See fork. Of course, the problem with the above is that I haven't done proper child reaping -- see perlipc. In your case, you may want to just setsystem('perl -w perlscript1.pl) if !fork; system('perl -w perlscript2.pl) if !fork;
before you invoke the forks. You'll also probably want to swap system to exec, since in the sample case you aren't waiting on a return value.$SIG{CHLD} = 'IGNORE';
There's a lot of additional complexity, but this is the basic concept.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Running perl scripts in parallel
by perl_help26 (Beadle) on Jul 23, 2014 at 15:52 UTC | |
by kennethk (Abbot) on Jul 23, 2014 at 16:31 UTC | |
by perl_help26 (Beadle) on Jul 24, 2014 at 07:05 UTC |