Re: BEGIN, INIT etc...
am 30.03.2008 04:17:21 von Joost Diepenmaat"szr"
> Ben Morrow wrote:
>> Quoth Joost Diepenmaat
>>> 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/