opensourcer has asked for the wisdom of the Perl Monks concerning the following question:
now Guardpackage Server; use Guard; sub new { my ($caller, %args) = @_; my $this = $caller || ref($caller) die; return bless[], $this; } 1;
k, the above code does the work, but it does not stay alive.package Guard; $SIG{__DIE__} = \&diewatcher; $SIG{'QUIT'} = \&diewatcher; sub diewatcher { $SIG{__DIE__} = 'DEFAULT'; print "Na na u can't that \n"; } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: trapping signals
by Joost (Canon) on Nov 23, 2006 at 16:43 UTC | |
|
Re: trapping signals
by geekphilosopher (Friar) on Nov 24, 2006 at 00:27 UTC |