use Run; my $cfg_test = "conf_ini"; my $cfg_stat = "fresh"; my $system_call = '/test/conf.pl'; $pid = spawn $system_call, $cfg_test, $cfg_stat or die "spawn: $!"; push @pids, $pid; my $num_proc1 = @pids; while ($num_proc1) { for ( my $i=0; $i< @pids; $i++) { waitpid($pids[$i],0); $num_proc1 --; $pid --; } print "DOES THIS -- $? -- CAPTURE ANYTHING\n"; if ( $system_call >> 8, 0, 'Normal exit' ){ print "good\n";} if( $exit >> 8, 42, 'Non-zero exit' ){ print "bad\n";} if ($? == 13) { print "failed: $!\n"; } elsif ($? & 127) { print "$pid died with signal $?\n", ($? & 127), ($? & 128) ? 'with' : 'without'; } elsif ($? > 0) { print "$pid died with signal $?\n"; } else { print "$pid exited with value $?\n", $? >> 8; }