"szr" <szrRE [at] szromanMO.comVE> writes:
> Ben Morrow wrote:
>> Quoth Joost Diepenmaat <joost [at] zeekat.nl>:
>>> if (! fork()) { # assumin fork() doesn't fail here.
>>> exec $whatever;
>>> exit;
>>
>> You need POSIX::_exit here, or the END blocks get run twice (once for
>> each process).
>
> This could actually desirable in some cases, such as when you need to
> free/clean-up in each child? (Albiet it would probably be done
> differently.)
Normally, the exec() would succeed, and the exit() would not be called
at all. I tried to ignore all error handling, and that exit() statement
just slipped through.
--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
