asz has asked for the wisdom of the Perl Monks concerning the following question:

hello,

i'm creating a CGI::Application based webapp under mod_perl 2 and i switched to Apache2::Reload so i don't have to restart Apache everytime i make a change to one of the webapp's modules.

at the start of the modules i use the  use warnings FATAL => 'all'; pragma, but that dies with Subroutine redefined... unless i specify  no warnings 'redefine';. Everything works fine if i only  use warnings; (no warnings in the Apache's log).

so i have the solution to my problem, but i would like to understand why this happens as i couldn't find much information elsewhere. thank you for your time.

UPDATE: i didn't get any warnings when  use warnings; because i was using  PerlSetVar ReloadConstantRedefineWarnings Off in my Apache configuration... i don't understand what's with the warnings about redefined things and why would them be useful in a non-persistent environment...

Replies are listed 'Best First'.
Re: Apache2::Reload and use warnings FATAL => 'all'
by ides (Deacon) on Feb 12, 2006 at 16:04 UTC

    The warnings you're getting aren't anything to be worried about in production. What I believe is happening is that when Apache2::Reload is actually reloading your code it has to redefine the subroutines, which causes an informational warning, but because you have warning's set to FATAL it causes your application to die. I would suggest not using FATAL until you are ready to launch and then don't use it in conjunction with Apache2::Reload.

    Frank Wiles <frank@revsys.com>
    www.revsys.com