![]() |
|
Do you know where your variables are? | |
PerlMonks |
Re: Warnings for unused subsby danger (Priest) |
on Jul 25, 2002 at 16:52 UTC ( #185249=note: print w/replies, xml ) | Need Help?? |
Just an additional note --- 'used only once' won't come into play in a variety of situations:
In 5.6.1, the above throws warnings for FOO and DIR, and all of the our variables, but nothing else --- in 5.8.0, only FOO and DIR elicit warnings. Variables declared with 'use vars' (and now our) are exempt, as are subroutines and lexicals. To top it off, 'used only once' really only applies to things in the symbol table, and in particular, is elicited only when the *typeglob is used but once --- as soon as two or more slots in a typeglob are filled, all identifiers within that typeglob are exempt:
No warnings --- even though $main::bar is used only once, the *bar identifier is used more than once.
In Section
Seekers of Perl Wisdom
|
|