In the perllexwarn man page, it states that "the scope of the warning
pragma is limited to the enclosing block. It also means that the
pragma setting will not leak across files (via use, require or do).
This allows authors to independently define the degree of warning
checks that will be applied to their module."

I'm more interested (at $JOB) in global warnings, actually.  Of course
one can enable those with $^W or "perl -w" and I do, but developers
ignore the warnings all too often.  Many of our core modules were
written without warnings enabled, and people are slow to fix those
warnings.  So, we want to make warnings fatal in the development
environment to force developers to fix those niggling "uninitialized
value" warnings that are all over the place in our log files.

We can do this in a lexical way with the FATAL option to warnings.pm,
but that would only affect one file, and we don't want to have to
modify every file in our code base to do this.  And since we want it
to be enabled only in the development environment, it would have to be
some kind of ternary operator conditional testing an environment
variable and only setting fatal if that indicates debug mode.

So, do I need to monkey with $SIG{__DIE__} or something?  I haven't
yet tried peeling back the covers of warnings.pm to see if there's
some way I can enable FATAL globally... before I did that I thought
I'd ask if anyone here has done it.

-- 
Check out my LEGO blog at http://www.brickpile.com/
View my photos at http://flickr.com/photos/billward/
Follow me at http://twitter.com/williamward

Reply via email to