I use a technique somewhat similar as a test harness when I first get a script. I created a module that actually will force the importing module to use strict and warnings as well as install confess as the default die and warning handler. I use this only for testing purposes and never production code.
package WarningsStrictAndCarpOhMy; # worst name ever, I know use 5.006_001; use Carp; use strict; use warnings; sub import { my %config; undef @config{@_}; $^H |= strict->import unless exists $config{'no_strict'}; ${^WARNING_BITS} |= warnings->import; $SIG{__DIE__} = \&wasnt_me; $SIG{__WARN__} = \&wasnt_me; } sub wasnt_me { Carp::confess($_[0]); } 1;
Just thought someone else might be able to get some use out of it
antirice
The first rule of Perl club is - use Perl
The ith rule of Perl club is - follow rule i - 1 for i > 1
In reply to Re: Die On Warnings
by antirice
in thread Die On Warnings
by rkg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |