in reply to Re: Identify Unused and Uninitialised variables.
in thread Identify Unused and Uninitialised variables.

Unfortunally, that may mean that the following code:
sub foo { my $i; for $i (...) { ... if (...) { my $i; $i = something; ... } } }
may end up as:
sub foo { my $i; for $i (...) { ... if (...) { # my $i; $i = something; ... } } }
However, the inner '$i' certainly wasn't an unused variable.

Replies are listed 'Best First'.
Re^3: Identify Unused and Uninitialised variables.
by Mr. Muskrat (Canon) on Jan 14, 2009 at 16:01 UTC

    You are right. You are absolutely right.

    Any code written like that could have unintended bugs but they will learn a valuable lesson in proper variable naming conventions at the same time.