http://www.perlmonks.org?node_id=26694

reptile has asked for the wisdom of the Perl Monks concerning the following question:

The situation: I have a process that forks, uses setsid() and then the new process forks again. One process sits and waits for connections and the other loops infinitely to do some background stuff (using shared memory, the process that takes connections will be able to fool with the data the other process uses). The problem is, when I kill the process leader -- the one that setsid()s -- its kid doesn't go away. I was under the impression that when you kill the process group leader the children are killed off too, but I guess I was wrong, or I'm doing something wrong.

The question: How can I get the children to go away when their parent is killed?

local $_ = "0A72656B636148206C72655020726568746F6E41207473754A"; while(s/..$//) { print chr(hex($&)) }