Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Warning about unused lexical variablesby Rhandom (Curate) |
on Sep 04, 2007 at 20:20 UTC ( [id://637021]=note: print w/replies, xml ) | Need Help?? |
At first glance it sounds like a great idea. And it is to a certain extent. But there is an existing system in Perl that does that very thing, although only with global variables.
Speaking from experience, this warning has never helped me. It has done the opposite. It has always been a hinderance. It has forced me to write things similar to the following: Arguably, I should have a function in SOME_PKG that returns the value of $SOME_VAL. But there are many existing modules that don't provide accessors. Use strict catches all of my typos. A warning of this sort never has. Still - I could see a use for it, but I think I'd want it as an extra-extra pragma:
my @a=qw(random brilliant braindead); print $a[rand(@a)];
In Section
Seekers of Perl Wisdom
|
|