in reply to Re^2: Getting a Perl program to close a command it starts when the perl program exits?
in thread Getting a Perl program to close a command it starts when the perl program exits?

Don't use shell meta-characters (such as >) and the shell won't get involved. Or use IPC::Open3's open3 instead of open '...|'.

One important difference between open and open3 is that open will call waitpid for you when the file handle is closed (implicitely or explicitely), while open3 won't. You have to call waitpid if you use open3 or you'll end up with zombies.

  • Comment on Re^3: Getting a Perl program to close a command it starts when the perl program exits?
  • Select or Download Code

Replies are listed 'Best First'.
Re^4: Getting a Perl program to close a command it starts when the perl program exits?
by buzzthebuzzsaw (Acolyte) on Aug 29, 2007 at 17:22 UTC
    I wasn't too bothered by the redirection, it was just to remove any error messages from tail.
    When it was removed all was well!

    Thanks for all this help, I've learned quite a bit. I never knew about the END block or that the redirection would get the shell involved. Thanks again.