my $pid = eval { open3($WRITE, $READ, $ERROR, "$command") }; if (!$pid) { # We're in the child. # The fork succeeded, but the exec failed. POSIX::_exit($!); } ...