mention need to wait for children (from Russ Allbery)
[p5sagit/p5-mst-13.2.git] / lib / IPC / Open2.pm
index 161620b..a5a3561 100644 (file)
@@ -55,6 +55,13 @@ failure: it just raises an exception matching C</^open2:/>.  However,
 C<exec> failures in the child are not detected.  You'll have to
 trap SIGPIPE yourself.
 
+open2() does not wait for and reap the child process after it exits.
+Except for short programs where it's acceptable to let the operating system
+take care of this, you need to do this yourself.  This is normally as
+simple as calling C<waitpid $pid, 0> when you're done with the process.
+Failing to do this can result in an accumulation of defunct or "zombie"
+processes.  See L<perlfunc/waitpid> for more information.
+
 This whole affair is quite dangerous, as you may block forever.  It
 assumes it's going to talk to something like B<bc>, both writing
 to it and reading from it.  This is presumably safe because you