Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the HTTP-Exception CPAN distribution.

Report information
The Basics
Id: 79021
Status: resolved
Priority: 0/
Queue: HTTP-Exception

People
Owner: TMUELLER [...] cpan.org
Requestors: GTERMARS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.04001
Fixed in: (no value)



Subject: Eliminate warnings about "subroutine redefined"
Have run into this on a mod_perl based application I'm working on, where I'm using HTTP::Exception; screen after screen of warnings: Constant subroutine code redefined at (eval 614) line 4. Constant subroutine _status_message redefined at (eval 614) line 5. ... Happens as each time I load another module that pulls in HTTP::Exception, it redefines all of the subs again on import. Rather than trying to get it to only import the subs once, I've found that just putting a no warnings 'redefine'; right before the final "eval $code" at the end does the trick. Methods get redefined (which is fine), but the screens full of warnings disappear and also no longer show up in my Apache log.
Hi GTERMARS, thanks for your bugreport. I was able to reproduce the warnings, when doing eval 'use HTTP::Exception'; twice. Applying your suggested fix worked for me and a new version has been released to cpan. Unfortunately I forgot to include your nickname in the Changesfile, I hope you don't mind. Maybe you can test the new version, because I don't have a mod_perl environment at hand. Feel free to reopen this ticket or create a new one, in case the fix did not work. cheers, TMUELLER
On Thu Aug 16 19:36:07 2012, TMUELLER wrote: Show quoted text
> I was able to reproduce the warnings, when doing > > eval 'use HTTP::Exception'; > > twice. Applying your suggested fix worked for me and a new version has > been released to cpan. Unfortunately I forgot to include your nickname > in the Changesfile, I hope you don't mind. > > Maybe you can test the new version, because I don't have a mod_perl > environment at hand. Feel free to reopen this ticket or create a new > one, in case the fix did not work.
Thomas, wanted to write back to let you know that I've updated to this latest version and can confirm that it successfully addresses the problem I had encountered. Thank you!!