POSIX:_exit($status)

Minty mintywalker at gmail.com
Mon Oct 6 19:24:02 BST 2008


I have some code that forks.  Master process kicking off a bunch of
shorter lived children, which exit when they are done.

It took me far to long to get that Doh moment when I realised I had an
END {} block buried in some code that was being triggered when the
forked child exit'd.  I wanted the END block to execute when the
master process exited.

I could use POSIX:_exit($status) in my forked children, which will
avoid END blocks being called I gather.

This seems wise, as although I can factor out my END block, it seems
like a great source of future bugs - pull in some module that has an
END block, and lo, strange errors.

I'm wondering if there are other things I need to worry about when
using the POSIX _exit?

What clever things does Perl's exit do that I won't get?


More information about the london.pm mailing list