Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Children with Win32::Process when dying

by syphilis (Archbishop)
on Jun 07, 2006 at 06:22 UTC ( [id://553968]=note: print w/replies, xml ) Need Help??


in reply to Children with Win32::Process when dying

Perhaps in the "non-Tk script" you can include an END{} block - something like:
END{$obj->Kill($exitcode) if $obj->GetExitCode() == STILL_ACTIVE};
For that to work you'll need to be using version 0.10 of Win32::Process and you'll need to load the module as:
use Win32::Process (STILL_ACTIVE);
Even with earlier versions of Win32::Process there's probably a way of doing it - assuming that the END{} block is the way to go - which I've not properly tested. In fact you might even find it sufficient to simply:
END{$obj->Kill($exitcode)};
which would work for earlier versions of Win32::Process, too.

Also check the syntax of the GetExitCode() call (if you find you need to use it). The docs have it written as
$ProcessObj->GetExitCode($exitcode);
but supplying an argument doesn't smell right to me.

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: Children with Win32::Process when dying
by spurperl (Priest) on Jun 08, 2006 at 04:52 UTC
    The simple END {} cleanup helped. I wonder how it could have slipped from my mind :-)

    Thanks a lot

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://553968]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-19 20:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found