You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2003/06/03 02:23:03 UTC

Re: [patch] shutting down 'constant sub redefined' in Apache::Reload

Stas Bekman wrote:
> Philippe M. Chiasson wrote:
> 
>> On Mon, 2003-05-26 at 15:46, Stas Bekman wrote:
>>
>>> Currently if you have used a constant sub in your code, 
>>> Apache::Reload will complain every time the code is reloaded. And for 
>>> a good reason:
>>> http://groups.google.com/groups?threadm=20020519214851.3981.qmail%40airtrout.tregar.com 
>>>
>>> http://archive.develooper.com/perl5-changes%40perl.org/msg04919.html
>>>
>>> However it's a bad thing not being able to shut those warning, if you 
>>> know that you didn't modify the constant subs. The approach suggested 
>>> by Rafael is to use $SIG{__WARN__} override, only for those who know 
>>> what they are doing:
>>>
>>>   PerlSetVar ReloadNoWarningsConstantRedefine on
>>>
>>> here is the patch. Not sure if that variable is not too long... may 
>>> be shouldn't use reverse logic but:
>>>
>>>   PerlSetVar ReloadWarningsConstantRedefine off
>>>
>>> with 'on' being the default.
>>
>>
>>
>> Sure prefers non-reverse logic myself ;-)
>>
>>
>>> better name suggestions are welcome as well.
>>
>>
>>
>> PerlSetVar ReloadAllowConstantRedefine on/off ???
> 
> 
> yes, but you don't want to "allow" constants to be redefined, you can't 
> control that, as they will be redefined. All you want is to be able to 
> shut the warning. Dunno what happens if Apache::Reload tries to undef 
> those first.

Eventually I went with non-reversed logic as you have suggested.

   PerlSetVar ReloadConstantRedefineWarnings Off


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org