in reply to automatically killing all child processes created in a script

You could let the parent process become process leader of a new session, and then kill the process group by using a negative signal to kill itself. See POSIX::setpgid/POSIX::setsid, perlipc and perldoc -f kill.

Replies are listed 'Best First'.
Re^2: automatically killing all child processes created in a script
by swartz (Beadle) on Aug 21, 2009 at 23:59 UTC
    But if httpd, for example, properly daemonizes and becomes the leader of its own new session, this method won't catch httpds I create, right?
      True.

      And if you cannot record the pid of a grandchild process, there's always a way for the grandchild to distance itself from the family tree. Double forking will leave its parent PID to be 1, so there's no way to find it by tracing the process tree. And it can escape from a process group.