in reply to Re^2: system() Creating Different Results than Commandline Operation.
in thread system() Creating Different Results than Commandline Operation.

-1 is not a valid value for $?, so it's a bug to expect system_no_output to return -1.

If you want -1 when system fails and $? otherwise, you want:

# Your version $result = system(@_);
# My version my $pid = open3($chld_in, $chld_out, $chld_err, @_) or return -1;

your solution to rewrite system_no_output seems to hang waiting for gcov to return

system waits for the child to return, so I did the same.