in reply to nohup & PERL.

Not having netcat to attempt any testing, you should probably be saving the return value of open which is luckily the PID of your child (netcat). You might then try explicitly kill-ing the child before you exit.

You might find perlipc helpful as well. Specfically the TCP client, which ould allow you to forgo the use of netcat.

--
perl -pe "s/\b;([mnst])/'\1/mg"

Replies are listed 'Best First'.
Re: Re: nohup & PERL.
by Anonymous Monk on Apr 16, 2002 at 23:46 UTC
    Thanks this is good information. Unfortunately, the programs are on two servers across a network so IPC won't work. Also, the problem is not a normal death. It is when a kill comes from the outside. Is there a way to capture all signals? If so, then I could explicitly kill the netcat process, otherwise I'm still toast. What I was really hoping for was a way to call a process from PERL that forces the child process to die if PERL, the parent process, dies. Thanks, Daniel
      Again I recommend reading perlipc, as hossman has seconded. The other things he also suggests are good places to start.

      As for capturing all signals you might look at sigtrap. Or you could do the following:

      $SIG{$_} = \&handler for keys %SIG;
      Note that will also call handler when you die or warn.

      --
      perl -pe "s/\b;([mnst])/'\1/mg"