in reply to Re^4: how to kill background process when script exit?
in thread how to kill background process when script exit?

I'm confused now. I thought you wanted to kill the child program at the end of your script?

Now you say you don't want to kill the child program. Which is it?

  • Comment on Re^5: how to kill background process when script exit?

Replies are listed 'Best First'.
Re^6: how to kill background process when script exit?
by Allasso (Monk) on Feb 20, 2011 at 01:07 UTC
    I want to kill the child program when the perl script exits. not sure where you got the other.

      Then the code I gave you should already work and kill the child at the end of the program. Maybe closing the filehandle to the kid and also adding a call to kill outside the END block helps to kill the kid earlier.

        Okay, I tried that - closing the filehandle and putting the kill at the end of the script - still no go. Perl program stops executing until I exit the java app. It just does not seem that open() is launching the process in the background.