http://www.perlmonks.org?node_id=513168


in reply to system() does not wait

I don't think that SCRIPT2 is ever getting invoked. The reason I think that is that I strongly suspect that $? is -1 inside SCRIPT1. (please post the actual $? value, not $?>>8)

I strongly urge you to put the following code, taken from the perlfunc manpage where it talks about the system call, after your call to system:

if ($? == -1) { print "failed to execute: $!\n"; } elsif ($? & 127) { printf "child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without'; } else { printf "child exited with value %d\n", $? >> 8; }
I suspect that you'll see the "failed to execute" message.
--
@/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/