Yaakov has asked for the wisdom of the Perl Monks concerning the following question:
However, I have a small problem: When I call a normal sub
routine (not a method) and have the -w switch on, I get
a warning:
Use of inherited AUTOLOAD for non-method PKG::foo is depreciated at (eval 412) line 42.
I would like to switch this warning off but leave all other
warnings on. Is there a good way to do it?
At the moment, I hacked the perl source: I found the line where the error message is generated. There I added code to check the variable $CB::NoWarning. If it is false, the warning will be issued as usual. If it is true, the warning is suppressed.
It works, but it doesn't look right...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Switch off warning for UNIVERSAL::AUTOLOAD
by merlyn (Sage) on Aug 08, 2000 at 16:29 UTC | |
by Yaakov (Novice) on Aug 08, 2000 at 22:05 UTC | |
by Yaakov (Novice) on Aug 08, 2000 at 18:28 UTC | |
|
RE: Switch off warning for UNIVERSAL::AUTOLOAD
by Anonymous Monk on Aug 08, 2000 at 22:05 UTC | |
by Yaakov (Novice) on Aug 08, 2000 at 22:16 UTC |