in reply to child process killing

By the time you've evaluated backticks, the child process is always already over.

Perhaps you mean a grandchild process?

In that case, you'll need to discover some out-of-band way to determine the kid, and kill it in an END block or something. I'm not a windows expert, so I'll stop there. {grin}

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Re: child process killing
by Seshouan (Acolyte) on Oct 19, 2001 at 01:03 UTC
    Thanks, but I do plan to exit the first process when it's inside the backticks sometimes, would you know of any to do that and have the child process die?
      You may plan to exit, but what merlyn is saying is that the backtick operator isn't interruptable. You may be thinking of fork, which lets the parent and the child go their merry ways.

      I'm not sure what would happen if the parent caught a signal while waiting for the backtick operation to complete, but it's possible you could interrupt the process there and exit the whole program. The only other possibility that comes to mind is causing a core dump or a segfault, and if you do that, the Perl 5 Porters would probably like to know how.

      In short, the backticks operator tells perl "run this program, wait for its output, and give it to me". You're not likely to get it to skip the second and third steps. (By "not likely", I mean, "even if you do find a way, you probably won't like the results.")