I'm trying to build a module that will handle all our perl in a nice way, along the way I have trapped
$SIG{__DIE__}. After doing my thing, I want to hand it back, but I get an "
Use of uninitialized value in scalar assignment at Hps.pm" error.
The Package:
package Hps;
my $origHandler = $SIG{__DIE__};
$SIG{__DIE__} = 'Hps::grimReaper'
unless ($^D);
sub grimReaper
{
# We can drop out early if $^S is set because that means we're in
+an eval
die (@_)
if (not defined $^S or
($] >= 5.005 and defined $^S and $^S));
# .. do some stuff ..
# It is this line that causes an error.
$SIG{__DIE__} = $origHandler;
die "@_";
}
The script:
#!/usr/bin/perl -w
use strict;
use Hps;
die ("Oh no!");
Is this a feature of the -w switch, or can I do this in a nicer way?
Server Error (Error ID 1274635c2136032)An error has occurred. The site administrators
have been notified of the problem and will likely
soon fix it. We thank you, for you're patients.