There are several ways to launch a child process from Perl.
If all you want to do is to run each of the processes in order,
then the
system function might be what you are looking for.
Note that 'system' does not hand back output from the called program.
Rather, it returns the exit code from the called program.
It returns '-1' if it fails to execute the requested program.
Each system call runs the indicated program to completion and
then returns to continue executing the main Perl program.
See perldoc -f system for more details.
An example with some very simple error checking.
Code:
$success = system("p1");
if ($success == '-1') { print "program didn't run, $!\n"; }
$success = system("p2");
if ($success == '-1') { print "program didn't run, $!\n"; }
$success = system("p3");
if ($success == '-1') { print "program didn't run, $!\n"; }
$success = system("p4");
if ($success == '-1') { print "program didn't run, $!\n"; }
Since you can catch the exit value of the called program,
your error checking could be a lot stronger.
HTH 'hope this helps
If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.