R
Rainer Weikusat
At least on perl 5.10.1, in contradiction to the documentation which
states
Use "defined($pid)" to determine whether the open was
successful.
when the implicit fork done by open($fh, '|-') or open($fh, '-|')
fails for another reason than EAGAIN, the Perl interpreter executes
Perl_croak with "Can't fork" as argument. Because of this, code which
is supposed to handle 'pipe-to-self' open errors needs to check the
return value and the invocation has to be wrapped in an eval {} so
that the process doesn't die because of this uncaught exception
(problem observed on Linux at a really inconvenient time .
states
Use "defined($pid)" to determine whether the open was
successful.
when the implicit fork done by open($fh, '|-') or open($fh, '-|')
fails for another reason than EAGAIN, the Perl interpreter executes
Perl_croak with "Can't fork" as argument. Because of this, code which
is supposed to handle 'pipe-to-self' open errors needs to check the
return value and the invocation has to be wrapped in an eval {} so
that the process doesn't die because of this uncaught exception
(problem observed on Linux at a really inconvenient time .