Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The "used only once" warning isn't there to spot declared,
but unused variables. They are harmless. The "used only once"
warning is there to catch typos in variables - "use strict"
won't catch typos in fully qualified variable names - which
certainly can be harmfull.
Personally I think this warning is one of the more annoying ones. It triggers to many false positives (at least, for the way I code). I hate having to use local, our, or use vars just to quiet the warning. I'm not sure what you mean by "using a string as a number". Scalars in Perl are both strings and numbers. But Perl does already warn you (if you have warning on) if you use a string that doesn't look like a number as an operand for an arithmetic operation.
Abigail In reply to Re: Using "my" suppresses "Name used only once" warning?
by Abigail-II
|
|