http://qs321.pair.com?node_id=553965

spurperl has asked for the wisdom of the Perl Monks concerning the following question:

Hello all,

I have a non-Tk script that opens an external program with Win32::Process and talks to it via sockets. When my script exits normally - during runtime (by either ending its run or with an explicit 'die' or 'exit') everything is fine. However, when the script is killed by the perl interpreter because of some runtime-discovered mistake (like trying to access @{$arr} when $arr turns out not to be an array reference), the child process keeps running after my scipt ends, which is very annoying.

How can I solve this problem ?

TIA

2006-06-07 Retitled by holli, as per Monastery guidelines
Original title: 'Children with Wi32::Process when dying'