>
>You could do it this way:
>
>  END {
>    kill TERM, keys %childs;
>  }
>
>which will kill the child processes regardless of how the program ended;
>with the exception of `kill 9`, of course.
>

No,I think it's not so right here.
Under your statement,when all childs exited,they also send a SIGTERM to 'keys 
%childs',because END{} block is used by all childs when they get exited.
I would modify it as:

END {
    kill TERM, keys %childs if $$ == $pid;
}

Here $pid is the parent's pid.Then we stop the 'kill' to happen in childs.
I hope I'm correct.

--
Jeff Pang
NetEase AntiSpam Team
http://corp.netease.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to