Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

How to make all warnings FATAL via PERL5OPT

by j1n3l0 (Friar)
on Apr 12, 2012 at 22:35 UTC ( #964828=perlquestion: print w/replies, xml ) Need Help??
j1n3l0 has asked for the wisdom of the Perl Monks concerning the following question:

Hi all

According to perl5120delta you can switch warnings on via an environment variable PERL5OPT in perl 5.12 and greater. Is it possible to make these warnings FATAL as you would by doing the following in a script:

use warnings 'FATAL' => 'all';

Thanks :)


Smoothie, smoothie, hundre prosent naturlig!

Replies are listed 'Best First'.
Re: How to make all warnings FATAL via PERL5OPT
by Anonymous Monk on Apr 13, 2012 at 02:33 UTC

    -Mwarnings=FATAL,all

    $ perl -Mwarnings=FATAL,all -le " printf qq/%s %s / , 1, 2; print q/hi +/;" 1 2 hi $ perl -Mwarnings=FATAL,all -le " printf qq/%s %s / , 1; print q/hi/;" Missing argument in printf at -e line 1.
Re: How to make all warnings FATAL via PERL5OPT
by educated_foo (Vicar) on Apr 12, 2012 at 23:10 UTC
    Yes it is. You want to first turn that "use" line into a command-line option, then put that in the PERL5OPT environment variable. See perlrun for details

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://964828]
Approved by BrowserUk
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2017-11-23 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (330 votes). Check out past polls.

    Notices?