Leif Ericksen am Samstag, 7. Januar 2006 00.12:
> On Fri, 2006-01-06 at 15:58 -0700, Wiggins d'Anconia wrote:
> > Please bottom post...
> >
> > Leif Ericksen wrote:
> > > Actually not quite what you thought on the output...
> > > $ ./myt.pl
> > > ZERO:0   => SIG{'ZERO'} = &sigcat
> > > HUP:1    => SIG{'HUP'} = &sigcat
> > > INT:2    => SIG{'INT'} = &sigcat
> > > QUIT:3   => SIG{'QUIT'} = &sigcat
> > > ILL:4    => SIG{'ILL'} = &sigcat
> > > TRAP:5   => SIG{'TRAP'} = &sigcat
> > > ABRT:6   => SIG{'ABRT'} = &sigcat
> > > BUS:7    => SIG{'BUS'} = &sigcat
> > > FPE:8    => SIG{'FPE'} = &sigcat
> > > KILL:9   => SIG{'KILL'} = &sigcat
> >
> > Ah yep missed the double quotes.
> >
> > > Also if I use the double quote as opposed to a single quote in:
> > > SIG{'$name'} = \&sigcat;
> >
> > The above should be:
> >
> > $SIG{$name} = \&sigcat;
>
> That causes...
> ./myt.pl
> ZERO:0   => SIG{'ZERO'} = &sigcat
> Segmentation fault

perldoc perlipc states:

"Another interesting signal to send is signal number zero.  
This doesn't actually affect a child process, but instead 
checks whether it's alive or has changed its UID."

I'm not a signal guru, but I think you can't assign a handler to the ZERO 
signal. I also got a segfault.

Look at the following code, modified from yours.

BTW, your chances for answers are bigger if you provide code that can be run 
by list members.

#!/usr/bin/perl
use strict;
use warnings;

use Config;

my $i = 0;
my (@signames, %signos); 

defined $Config{sig_name}
  or
  die "The Stupid System does not support Signals?";

sub sigcat {print "sigcat called"; exit;};

foreach my $name (split(' ', $Config{sig_name})) {
   next if $name eq 'ZERO';  
   $signos{$name} = $i; 
   $signames[$i] = $name;
   print "$name:$i \t => SIG{$name} = \&sigcat\n"; 
   $SIG{$name}=\&sigcat;  
   $i++;
}

{} while 1;



hth joe

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to