I want to kill a process which was started with Win32::Process::Create. Just to make clear what about I want to achieve, here a few lines of Unix shell scripting, which I am more familiar with:

# This example is bash or similar myprog & bpid=$! .... kill -KILL $bpid
Here is my Perl solution:
Win32::Process::Create($process_obj,....); .... # Kill! Kill! Kill! $process_obj->Kill(9);
My questions:
  1. Is this really a safe solution, or could there be circumstances where my code would fail?
  2. Also, to what extent could "Kill" be blocking? For example, if Kill allowed the process being killed to gracefully shut down, and is waiting until the process is really gone, it might be that the killer process has to wait until this is done.
  3. If the process being killed, has spawn own subprocesses, will they be killed too automatically?

-- 
Ronald Fischer <ynnor@mm.st>

In reply to Killing a process on Windows (Win32::Process question) by rovf

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.