in reply to Kill a process in perl windows and proceed only if it killed the process

In the general case, killing a process is an asynchronous event ... it can take an arbitrary amount of time, especially if there are interactive dialog-boxes involved, and this can pragmatically result in situations like deadlock; or even actual deadlock of the user-interface. So, fire the bullet but don't wait for the body to hit the floor. Emphatically don't wait...
  • Comment on Re: Kill a process in perl windows and proceed only if it killed the process

Replies are listed 'Best First'.
Re^2: Kill a process in perl windows and proceed only if it killed the process
by prashantktyagi (Scribe) on Jul 20, 2012 at 10:18 UTC

    will system(kill -9 <pid>) not work here ? I am just curious...

      Not on Windows. And if you are on a POSIX system, why shell out instead of using the built-in kill?
      Indeed, on Linux I myself prefer system(shutdown -r now).
      --
      if ( 1 ) { $postman->ring() for (1..2); }