[sf-perl] use {strict,warnings}

frosty biztos at mac.com
Mon Mar 3 19:04:05 PST 2008


Thanks, but that's exactly what I meant by my annoyances not being everyone's annoyances.

I think disabling warnings is a slippery slope even in a local context.  I suppose if everyone in an organization agreed that uninitialized warnings were the enemy it could make sense, but then why not take your case to the Perl community at large?

Of course sometimes you really have to disable warnings of some type locally or you'll go nuts, but I try to think of that as a last resort and limit it to the smallest possible context.

cheers

-- frosty


On Monday, March 03, 2008, at 05:05PM, "David Thompson" <dat1965 at yahoo.com> wrote:
>
>Does this help your situation any?
>
>  use warnings;
>  no warnings qw(uninitialized);
>
>See http://perldoc.perl.org/perllexwarn.html
>and perldiag
>
>> my $nope = undef;
>> printf "You set it to '%s'\n", $nope;               # warns.
>> printf "You set it to '%s'\n", $nope || 'UNDEF';    # better.
>> 
>> But:
>> 
>> my $stuff = join( "fee", "fi", "fo", $nope );       # warns, annoying (to me).
>> die "$nope would be nice";                          # warns, annoying (to me).
>> 
>> On the one hand I wish undefined values could be auto-vivified to 'UNDEF' in warn and
>> die, but on the other hand that's probably sqlplus poisoning my brain.
>> 
>> The problem, I find, with disabling warnings is that my list of annoying warnings may
>> not be the same as my colleague's list.  That plus you have nobody to blame but
>> yourself when you screw up.
>> 
>> The problem with *not* doing that is there is plenty of CPAN code that spews warnings
>> all over your log files if you happen to have any.
>
>
>
>      ____________________________________________________________________________________
>Never miss a thing.  Make Yahoo your home page. 
>http://www.yahoo.com/r/hs
>
>


More information about the SanFrancisco-pm mailing list