develooper Front page | perl.perl5.porters | Postings from March 2006

Re: Multiple Perl version support quandary

Thread Previous | Thread Next
From:
John Peacock
Date:
March 27, 2006 12:56
Subject:
Re: Multiple Perl version support quandary
Message ID:
4428518D.7060101@rowman.com
Yitzchak Scott-Thoennes wrote:
> Um.  If this code runs during actual live use of warnings, I don't think
> you're at liberty to change $SIG{__WARN__}.  It may already by in use.
> Is there a reason for not just changing $^W locally?  Or rewriting the
> warnings-triggering code?

I cannot just change $^W; this is one of the "mandatory" warnings which 
can only be suppressed via $SIG{__WARN__}.  I'm replacing the 
UNIVERSAL::VERSION sub (which is in C in the core) and I either hide the 
warning or ignore it; I cannot rewrite the code.

As to an already existing $SIG{__WARN__} handler, I suppose I could try 
and see if there is one and call that instead of warn() in my code.  The 
problem with that is that in my test files, I call 'no warnings' twice; 
I have to see if I can work out whether it was me calling the previous 
hook or someone else (does that make sense?)...

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About