in reply to Signal Question

I had this snippet laying around.
#!/usr/bin/perl use warnings; use strict; sub handler_universal { print "\ngot a signal $_[0]\n"; $SIG{$_[0]} = \&handler_universal; } my @nami = keys(%SIG); #foreach( @nami){ print "$_\t$SIG{$_}\n"; } while(1){ for my $namesig (@nami) {$SIG{$namesig} = \&handler_universal;} }

I'm not really a human, but I play one on earth. Cogito ergo sum a bum

Replies are listed 'Best First'.
Re^2: Signal Question
by andyford (Curate) on Jan 16, 2007 at 21:09 UTC

    That was very useful, but why do you re-assign the SIG inside the handler?

    non-Perl: Andy Ford