in reply to Re: $? is -1???
in thread $? is -1???

I've cut the handler down as much as I think I can to just:

while ((my $pid = waitpid(-1, &WNOHANG)) > 0) { $children--; # need this to tell when we're done $exits{$pid} = $?; # need this to see the problem }

then I dump %exits at the end of the script. However, I still see output like:

18106 0
18116 0
18113 -1
18105 0