note
LanX
<I>> I have 2 questions, are these 2 lines correct?</I><P><P>
Correct yes but...<P><P>
<I>> line 14 : local $SIG{__WARN__} = \&suppress_UV_warning;</I><P><P>
Personally I prefer anonymous subs if I never need to call them by name.<P><P>
<I>> line 50 : warn $message;</I><P><P>
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)<P><P>
Newer versions are fool proof. ;-)<P><P>
<H5> update<P></H5><P>
Talking about "generic solutions": <P><P>
Please be aware that this approach doesn't help if the module in question is also recklessly overwriting <c>$SIG{__WARN__}</c><P><P>
Therefore a safe way of overriding is to create a wrapper, which calls the overridden handler from within (if present in <c>$SIG{__WARN__}</c>). <P><P>
But you can only be sure after checking the source code of the module in question.<P><P>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-708738">
<p>Cheers Rolf
<p> <small>( addicted to the Perl Programming Language) </small>
</div></div>
1062996
1063005