This line is subtly wrong:my $execTwo = "$command &> log ";
Well, that might depend on what type of shell we're talking about. In bash, the ampersand followed immediately by ">" is the "preferred" way to redirect both stdout and stderr to the named output file, while in a C-shell, you have to use the angle-bracket followed by the ampersand (and bash also supports this order -- who knows why bash doesn't "prefer" it...)
Anyway, another confounding factor is that the shell invoked by perl's "system()" call might not be the same as the user's login shell, so things that the user can do on the command line might not work in the system() call.
So, the idea that the command is being backgrounded as well as having stdout redirected is certainly plausible, maybe even likely; but it's also quite understandable that the OP thought he was doing things the right way. The point is: be very careful about system calls that use shell-dependent syntax, and avoid such things as much as possible.
In reply to Re^2: Different values when using $? to detect seg faults
by graff
in thread Different values when using $? to detect seg faults
by Gmong
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |