M
msoulier
Reading my faithful Perl Cookbook on reaping children (wow that sounds
bad), I found this recipe.
use POSIX ":sys_wait_h";
$SIG{CHLD} = \&REAPER;
sub REAPER {
my $stiff;
while (($stiff = waitpid(-1, &WNOHANG)) > 0) {
# do something with $stiff if you want
}
$SIG{CHLD} = \&REAPER; # install *after* calling
waitpid
}
Unfortunately, when I use this, while it works, I get this warning from
POSIX:
Argument "CHLD" isn't numeric in subroutine entry at
/usr/lib/perl5/5.6.1/i386-linux/POSIX.pm line 38.
Seems that there is no symbol 'CHLD' in that module, and it's trying to
AUTOLOAD a subroutine.
Anyone else seen this? I'm using
# perl -v
This is perl, v5.6.1 built for i386-linux
Thanks,
Mike
bad), I found this recipe.
use POSIX ":sys_wait_h";
$SIG{CHLD} = \&REAPER;
sub REAPER {
my $stiff;
while (($stiff = waitpid(-1, &WNOHANG)) > 0) {
# do something with $stiff if you want
}
$SIG{CHLD} = \&REAPER; # install *after* calling
waitpid
}
Unfortunately, when I use this, while it works, I get this warning from
POSIX:
Argument "CHLD" isn't numeric in subroutine entry at
/usr/lib/perl5/5.6.1/i386-linux/POSIX.pm line 38.
Seems that there is no symbol 'CHLD' in that module, and it's trying to
AUTOLOAD a subroutine.
Anyone else seen this? I'm using
# perl -v
This is perl, v5.6.1 built for i386-linux
Thanks,
Mike