in reply to Re: A Quick fork theory question
in thread A Quick fork theory question

One possible solution is to use something like Proc::Simple to handle all your forks as nice simple objects.
In your parent body, install a sig handler that traps, say SIGUSR1.
On a child death, the child 'kills' the parent with SIGUSR1, making it wake up from a lengthy sleep, or other work, and take care of the signal in whatever way you want.
I'd use SIGUSR1, as I may be doing other things that invoke pipes, and that keeps invoking the SIGCHLD handler, if I install that. Which gets messy.
At least with SIGUSR1, you can be pretty sure it's what you want sending the signal.
In Proc::Simple, you simply iterate over an array of process objects to see which ones have died and how.

Hope this helps a little,

Malk