in reply to Re^2: IPC::Open3 and Real PID
in thread IPC::Open3 and Real PID

In unix, you'd do:

kill TERM => $pid;

I think that works in Windows too.

Replies are listed 'Best First'.
Re^4: IPC::Open3 and Real PID
by nusoff (Initiate) on Nov 19, 2009 at 18:12 UTC
    on windows $pid contains process id of cmd.exe :(

      We've already covered that.

      You've already been told that has nothing to do with Windows (the same would apply on other OSes).

      You've already been told how to avoid launching a shell. If you don't want to launch the shell, don't launch a shell command.

      Is there something you didn't understand? If so, say as much and we'll explain.

Re^4: IPC::Open3 and Real PID
by nusoff (Initiate) on Nov 19, 2009 at 22:53 UTC
    yeah, i have tried your code but IPC::Open3::open3 calls cmd.exe /x/d/c "COMMAND" and returns pid of cmd.exe i dunno why.
      Please show this code so we can report this bug in Perl.
Re^4: IPC::Open3 and Real PID
by nusoff (Initiate) on Nov 19, 2009 at 20:25 UTC
    sorry. on Windows, IPC::Open3 works through cmd.exe and if i killing process with pid returned by open3, called process stays alive. my solution is system("taskkill /f /IM child.exe"); :(

      IPC::Open3 works through cmd.exe

      Only when you ask it to. It doesn't if you follow my instructions.