Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
There's more than one way to do things
 
PerlMonks  

Re: When warnings get in the way

by itub (Priest)
on Apr 22, 2005 at 13:56 UTC ( [id://450517]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to When warnings get in the way

I have an ambivalent relationship with "uninitialized" warnings, because they result in false positives and get in the way more often than not. Sometimes I just start my script with:
#!/usr/bin/perl use strict; use warnings; no warnings 'uninitialized';

But for maximum safety you should leave them on, or just turn them off at a smaller scope.

Replies are listed 'Best First'.
Re^2: When warnings get in the way
by wazoox (Prior) on Apr 22, 2005 at 15:01 UTC

    Yup, quite agree with that. For instance when grabbing data from a database, some columns may be empty, though initializing the hash before fetching the data would be a real pain. So I often use something like

    no warnings; print Dumper(\%bighash); use warnings;

    but your

    no warnings 'uninitialized';

    is a neat trick, maybe I'll try this one next time.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://450517]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.