Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: When warnings get in the way

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


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 19: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
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2025-06-22 09:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.