in reply to no module warnings in client code
In general, the easiest and most appropriate way to silence warnings is to address what the warning is complaining about. Assuming you don't want to do that, your code above would work, assuming that the module does not implement its own warning control. If it does, you can cheat by locally clobbering the warning handler:
{ local $SIG{__WARN__} = sub {#Drop it}; RandomModule::doSomethingThatCanGenerateWarnings(); }
Update: Added some <del> tags following a node update.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: no module warnings in client code
by citromatik (Curate) on Aug 27, 2013 at 14:05 UTC | |
by 2teez (Vicar) on Aug 27, 2013 at 14:41 UTC |