The stupid question is the question not asked | |
PerlMonks |
Re^4: Is it possible to create a sub exclusive to a sub?by Aristotle (Chancellor) |
on Sep 19, 2004 at 10:35 UTC ( [id://392155]=note: print w/replies, xml ) | Need Help?? |
You use %main::test. That that's the same as *main::test{HASH} and *main::test{CODE} happens to be defined doesn't make it any less of a global variable. At least if you're going to go that route, do it directly
so that strict can catch your typos. (Though it still won't catch $test{lcoalsub}, as opposed to a lexical mistyped as $lcoalsub.) The way you wrote it deprives you of protection wholly. Makeshifts last the longest.
In Section
Seekers of Perl Wisdom
|
|