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

thanks for your response i use: my $pid = open3(...) So, what i need to do to kill spawned application?

Replies are listed 'Best First'.
Re^3: IPC::Open3 and Real PID
by ikegami (Patriarch) on Nov 19, 2009 at 17:52 UTC

    In unix, you'd do:

    kill TERM => $pid;

    I think that works in Windows too.

      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.

      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.
      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.