Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Re: Using "my" suppresses "Name used only once" warning?by Wysardry (Pilgrim) |
on Feb 02, 2003 at 23:53 UTC ( [id://232088]=note: print w/replies, xml ) | Need Help?? |
Well, I'm not really concerned if a variable is truly only used once, but more if it isn't used at all. Unfortunately, the act of using "my" in declaring a variable ready for use - even without setting a value - is counted as using it, which seems a little odd. I was hoping to be able to be warned if I'd declared a variable and then not used it for anything. This might happen if I removed a section of code, or declared a lot of variables at once in the early stages of coding, but then decided not to (or just plain forgot to) use one of them later in the development process. Oh, by the way, it isn't the strict pragma that's causing this - it is my (I tried this without strict, but with my).
In Section
Seekers of Perl Wisdom
|
|