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.