in reply to Namespace woes
And I found an evil line elsewhere that said:NO_WARNING( $variable );
Well, when I went searching for the source of this problem I found out that this had been implemented to avoid the typo warning, but then someone noticed that the constant wasn't being used and deleted it. This left only the sad attempt to silence the warning. Bad, very bad.sub NO_WARNING{}
My recommendation is to declare constants as subroutines. This not only avoids the warnings but makes the variable immutable.
Makes Constant alway return 2. Also, you can place these in a .pm perl module and import them that way so that you don't clutter your namespace.sub Constant(){2}
|
|---|