At 04:12 PM 11/21/2001 -0500, Tom Edelson wrote:
>Hey y'all, with enough trial and error I found something that works for me. The key
>is to forget about using 'die', and define an empty handler instead:
>If not using 'die', there's no need to use 'eval', either. The following works as
>well:
>
>sub synchronize {
>
> local $SIG {ALRM} = sub {};
If what you want is for it to be ignored, can't you just say
$SIG{ALRM}='IGNORE' ? But then half the things I've told you about this
haven't been true, so I could be wrong about that.
> print $writeme "PERL -e \"print kill (SIGALRM, $pid)\"\n";
> sleep;
>
> sleep 1; # to let the output from the inner Perl get printed before we go on.
>
>} # end sub synchronize
>
>So it looks like I can go about my business. But I've still got a shiny new sixpence
>for anyone who can tell me why the version with 'die' behaved so strangely.
One thing to consider is turning on flushing with C<$|=1;>. That should
ensure that data goes out the pipe as soon as you've written to it. Anyway,
glad you have something working despite my largely erroneous advice.