in reply to Re: Perl Signals
in thread Perl Signals
there is no need for "$SIG{"INT"} = "interrupt";" within interrupt() subroutine.
Interesting, because perlipc documents it this way:
or better still:use POSIX ":sys_wait_h"; sub REAPER { my $child; # If a second child dies while in the signal handler caused by the # first death, we won't get another signal. So must loop here else # we will leave the unreaped child as a zombie. And the next time # two children die we get another zombie. And so on. while (($child = waitpid(-1, WNOHANG)) > 0) { $Kid_Status{$child} = $?; } $SIG{CHLD} = \&REAPER; # still loathe SysV } $SIG{CHLD} = \&REAPER; # do something that forks...
So, has perl's behaviour changed (when?), is one of SIGINT, SIGCHLD special for perl, or is perlipc simply out-of-date?
Alexander
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl Signals
by Marshall (Canon) on Nov 14, 2011 at 22:23 UTC | |
by afoken (Chancellor) on Nov 17, 2011 at 16:51 UTC | |
|
Re^3: Perl Signals
by ikegami (Patriarch) on Nov 14, 2011 at 19:30 UTC |