Correct yes but...
> line 14 : local $SIG{__WARN__} = \&suppress_UV_warning;
Personally I prefer anonymous subs if I never need to call them by name.
> line 50 : warn $message;
You should check the Perl-version, IIRC this causes an endless loop in Perl older < 5.8 (?) (Too lazy to look up when it was exactly fixed)
Newer versions are fool proof. ;-)
Talking about "generic solutions":
Please be aware that this approach doesn't help if the module in question is also recklessly overwriting $SIG{__WARN__}
Therefore a safe way of overriding is to create a wrapper, which calls the overridden handler from within (if present in $SIG{__WARN__}).
But you can only be sure after checking the source code of the module in question.
Cheers Rolf
( addicted to the Perl Programming Language)
In reply to Re^2: How can I suppress 'uninitialized' warnings in a CPAN module?
by LanX
in thread How can I suppress 'uninitialized' warnings in a CPAN module?
by zork42
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |