graq has asked for the wisdom of the Perl Monks concerning the following question:
The Package:
The script: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 "@_"; }
Is this a feature of the -w switch, or can I do this in a nicer way?#!/usr/bin/perl -w use strict; use Hps; die ("Oh no!");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Handing back $SIG{__DIE__} under -w causes a warning?
by dave_the_m (Monsignor) on Jun 04, 2004 at 14:57 UTC | |
|
Re: Handing back $SIG{__DIE__} under -w causes a warning?
by Abigail-II (Bishop) on Jun 04, 2004 at 15:01 UTC |