On Sat Jul 23 01:55:34 2005, schwern wrote: > > [dha@panix.com - Fri Jan 05 01:38:47 2001]: > > > > Maybe there's a reason for it, but... > > > > ~ 12:35:18$ perl -wce '$count = 1;' > > Name "main::count" used only once: possible typo at -e line 1. > > -e syntax OK > > > > BUT... > > > > ~ 12:35:52$ perl -wce 'my $count = 1;' > > -e syntax OK > > > > Shouldn't that warning be raised, regardless of scope? > > I agree. In fact the argument for the warning is even stronger for a > lexical. A global seen only once... well maybe some other package grabs > at it. But a lexical declared but never used is useless. > > About the only counter argument I can see is that issuing the warning > for lexicals will cause a lot of existing code to start yelping. But > that's what warnings are for. I for one would like to know about unused > lexicals. > There's a CPAN module for that: http://search.cpan.org/dist/warnings-unused/ Requests to make this a core feature please make a separate ticket. -- George GreerThread Previous