Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: Turn matching against undef to be deadly

by vsespb (Hermit)
on Sep 26, 2013 at 13:50 UTC ( #1055836=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Turn matching against undef to be deadly
in thread Turn matching against undef to be deadly

As another Anonymous Monk pointed above you can use warnings 'FATAIL' for all warnings or only "uninitialized". Lexical scope used. But this will catch other types of "uninitialized" warnings.

use strict; use warnings; use Carp; use warnings FATAL => 'uninitialized'; printf "matched: %s\n" , ( 'x' =~ undef() ? 'yes' : 'no' ) ; print "end\n";


Comment on Re^3: Turn matching against undef to be deadly
Download Code
Re^4: Turn matching against undef to be deadly
by AnomalousMonk (Abbot) on Sep 26, 2013 at 16:00 UTC

    See perllexwarn for all the warnings that can be turned into FATAL-ities, etc.     (Update: Oops — didn't notice Anonymonk already linked these!)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1055836]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2014-10-20 09:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (74 votes), past polls