Re: BEGIN, INIT etc...

"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/
Joost Diepenmaat [ So, 30 März 2008 04:17 ] [ ID #1931982 ]
Perl » comp.lang.perl.misc » Re: BEGIN, INIT etc...

Vorheriges Thema: Re: BEGIN, INIT etc...
Nächstes Thema: Re: BEGIN, INIT etc...