Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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


    $ 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?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2018-07-21 02:31 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (443 votes). Check out past polls.