Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 cooling their heels in the Monastery: (14)
As of 2014-09-30 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (367 votes), past polls