At 11:40 AM 11/20/2001 -0500, Tom Edelson wrote:
>I'd love to find out that this is pilot error (sorceror's apprentice error?), but I 
>fear not.  It looks for all the world like, in certain circumstances, even if you 
>attempt explicitly to re-establish a signal handler that's been used, it won't work a 
>second time.  


I'm not sure I fully understand what you are trying to do, but the following 
change appears to make it work.  You have to import the POSIX constants if 
you want to use them, and the signal name is SIGALRM, not ALRM, though 
rather confusingly I think you are right that the key in %SIG is ALRM.

--- foo.pl;-0  Tue Nov 20 15:26:19 2001
+++ foo.pl     Tue Nov 20 15:32:01 2001
@@ -1,7 +1,8 @@
 use strict;
 use constant NL => "\n";
+use POSIX qw(:signal_h);
 
-my $pid = $ENV {'HOLD_PID'};
+my $pid = $$;
 
 print "Process ID is '$pid'.\n\n";
 
@@ -30,7 +31,7 @@
 
  eval {
   local $SIG {ALRM} = sub {die;};
-  print $writeme "PERL -e \"print kill (ALRM, 0x$pid)\"\n";
+  print $writeme "PERL -e \"print kill (SIGALRM, $pid)\"\n";
   sleep;
  };
 


Reply via email to