Ok, at this point I'm trying to clear up misunderstandings. I believe you
know where I stand with relation to your RFC.
On Wed, Sep 20, 2000 at 06:41:52PM -0700, Steve Fink wrote:
> Michael Fowler wrote:
> > Except for the line number reported, which is the important part.
>
> Oh. Certainly you'll get the line number. My description didn't include
> it because it didn't seem to aid to the understanding. I have it in the
> examples that I added to the RFC.
>
> I suppose it could even give both line numbers for declared variables:
> "use at line 7 of uninitialized variable declared at line 3."
Yes, you could do that, but it wouldn't catch this problem.
The example code:
$foobal = 3; # This $foobal is an intentional typo.
if (@ARGV) { $foobar = @ARGV }
print $foobar;
I want perl to tell me that $foobal, declared on line 1, was never used.
You want perl to tell me that $foobar, used on line 3, and declared on line
1 (!), was used uninitialized. I'm going to assume you didn't mean perl
should do code analysis to see exactly where I first misspelled the
variable. If it could, great! Somehow I doubt we're going to go there,
though.
> > I would. I have not done it personally, but I do maintain code that has
> > something along the lines of:
> >
> > my($foo, $bar, %baz, @qux, $quux, $blah ... ad nauseum);
> >
> > This new warning would make life difficult for me.
>
> It's not just having my($long, $list, $of, $variables). It's never
> saying $long = f().
Yes, I realize that. But more often than not the variables are used
undefined to indicate a certain state, and you want me to either insert a
"no warnings 'whatever'", or initialize all of those variables to undef
explicitly. I'm saying I want the code to work the same, because perl
already tells me about the use of uninitialized values, and my having used a
variable only once.
In fact, I don't want it to mention I've used it only once when I use use
strict and declare my variables; strict catches my misspellings, and at
compile-time, no less.
Michael
--
Administrator www.shoebox.net
Programmer, System Administrator www.gallanttech.com
--