NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Uhhm, yeah, but (Score:1)
I always use 'perl -w'. I almost always find that 'Use of unitialized value' inicates a mistake that I need to correct. Sure, if you are testing for defined(), then the code can catch this and do something intelligent, but that's not usually the case in my code.
Most typically, the use of an unitialized value in my code is a variable name typo, splitting into a list with fewer elements than I expected, a hash value that I assumed had to be there, etc.
Maybe I don't understand what you're getting at or maybe our coding styles are radically different, but I pretty much always want to be warned that I'm using an unitialized value.
Reply to This
Re:Uhhm, yeah, but (Score:1)
Maybe I don't understand what you're getting at or maybe our coding styles are radically different, but I pretty much always want to be warned that I'm using an unitialized value.
I do 'use strict,' so don't take me for a total slacker. I haven't seen many situations in my code that the 'uninitialize' warning is helpful. With 'use strict' and a -wc check, I can catch typos at compile time. After that, I normally *depend* on values being uninitialized. For instance:
Re:Uhhm, yeah, but (Score:1)
.=or+=(or|=, for that matter). I think it did in some older versions of Perl.Can you give an example of code where the "uninitialized" warning gets in your way?
Re:Uhhm, yeah, but (Score:1)
Re:Uhhm, yeah, but (Score:1)
Re:Uhhm, yeah, but (Score:1)
Yes, it is lame, but IMO, so is the warning itself.
Re:Uhhm, yeah, but (Score:1)