in reply to Die On Warnings
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Die On Warnings
by rkg (Hermit) on Sep 05, 2003 at 17:50 UTC | |
by antirice (Priest) on Sep 05, 2003 at 18:09 UTC |