Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Using "my" suppresses "Name used only once" warning?by Marza (Vicar) |
on Feb 02, 2003 at 23:15 UTC ( [id://232074]=note: print w/replies, xml ) | Need Help?? |
Why yes it does. Using the strict module forces you to declare variables lexically (using my $var) and belong to a block or file, or be declared globally. When it is declared to a block of code(ie sub), I guess the value of "used once" is no longer issue as the value disappears after the sub has completed. A global declaration well the same thing comes to play but they disappear at programs end. Mind you that is how I understand it. If I am wrong one of brothers will surely correct me! ;-)
In Section
Seekers of Perl Wisdom
|
|