When you run a process in the background via the shell (with the &), the return value is always zero. From shell (bash) docs:
If a command is terminated by the control operator &, the shell executes the command in the background in a subshell. The shell does not wait for the command to finish, and the return status is 0.
What you can do, though, is do something with the return value and then check it later... maybe create a file:
# clean up if the temp files were already there
unlink $_ or die "unlink $_: $!\n" for grep {-e $_} "/tmp/a$$", "/tmp/
+b$$";
system("(perl $rpla && touch /tmp/a$$) & (perl $rplb && touch /tmp/b$$
+)");
$rc = -e "/tmp/a$$" && -e "/tmp/b$$";
# cleanup temp files
unlink $_ or die "unlink $_: $!\n" for grep {-e $_} "/tmp/a$$", "/tmp/
+b$$";
There are other ways to do this, too... depending on whether you actually *wanted* the output of $rpla and $rplb to go to your terminal, you could do this without temp files at all:
my $output = `(perl $rpla >/dev/null 2>&1 && echo a) & (perl $rplb >/d
+ev/null 2>&1 && echo b)`;
my $success = $output =~ /a/ && $output =~ /b/;
Anyway, these all rely on the ability of the shell to fork off not just a single command, but a whole command list expression (and then you chain together the command whose status you want to check with another command that is conditional on the status of the first, and has side-effect that you can verify later).
------------
:Wq
Not an editor command: Wq