Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: cause perl to die on use of unintialized variables

by moritz (Cardinal)
on Jun 23, 2010 at 11:22 UTC ( #846053=note: print w/ replies, xml ) Need Help??


in reply to cause perl to die on use of unintialized variables

use warnings FATAL => qw(uninitialized);

should do what you want.

Update: if you don't want to add that to your file, but rather want it confined to development uses only, you can also run your perl script as

$ perl -Mwarnings=FATAL,uninitialized filename.pl

to get that effect without modifying your script. But beware, it can be overridden inside the script, or in modules used by the script.

For more information on the warnings pragma, please consult perllexwarn.

Perl 6 - links to (nearly) everything that is Perl 6.


Comment on Re: cause perl to die on use of unintialized variables
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2014-09-22 00:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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











    Results (176 votes), past polls