in reply to fork and zombies
If you truly don't care what your child processes return, just set $SIG{CHLD} = "IGNORE". If you do care, then you should setup an actual signal handler, $SIG{CHLD} = sub { my $pid = wait; $exits{$pid} = $?; }, or something similar.
Waiting on a specific pid is usually only done when you know that specific process has died.
Also, foreach my $pid (@pids) { ... }, you don't need a C-style for loop to iterate over an array.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: fork and zombies
by wolfger (Deacon) on Oct 24, 2007 at 16:52 UTC |