You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs-cvs@perl.apache.org by st...@apache.org on 2003/06/03 02:20:44 UTC
cvs commit: modperl-docs/src/docs/2.0/api/Apache Reload.pod
stas 2003/06/02 17:20:44
Modified: src/docs/2.0/api/Apache Reload.pod
Log:
document the new ReloadConstantRedefineWarnings option
Revision Changes Path
1.3 +26 -1 modperl-docs/src/docs/2.0/api/Apache/Reload.pod
Index: Reload.pod
===================================================================
RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/Reload.pod,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Reload.pod 17 Feb 2003 09:43:21 -0000 1.2
+++ Reload.pod 3 Jun 2003 00:20:44 -0000 1.3
@@ -19,7 +19,8 @@
PerlSetVar ReloadAll Off
PerlSetVar ReloadModules "ModPerl::* Apache::*"
#PerlSetVar ReloadDebug On
-
+ #PerlSetVar ReloadConstantRedefineWarnings Off
+
# Reload a single module from within itself:
package My::Apache::Module;
use Apache::Reload;
@@ -185,6 +186,30 @@
reloaded, are actually getting reloaded, turn the debug mode on:
PerlSetVar ReloadDebug On
+
+=head1 Silencing 'Constant subroutine ... redefined at' Warnings
+
+If a module defines constants, e.g.:
+
+ use constant PI => 3.14;
+
+and gets re-loaded, Perl issues a mandatory warnings which can't be
+silenced by conventional means (since Perl 5.8.0). This is because
+constants are inlined at compile time, so if there are other modules
+that are using constants from this module, but weren't reloaded they
+will see different values. Hence the warning is mandatory. However
+chances are that most of the time you won't modify the constant
+subroutine and you don't want I<error_log> to be cluttered with
+(hopefully) irrelevant warnings. In such cases, if you haven't
+modified the constant subroutine, or you know what you are doing, you
+can tell C<Apache::Reload> to shut those for you (it overrides
+C<$SIG{__WARN__}> to accomplish that):
+
+ PerlSetVar ReloadConstantRedefineWarnings Off
+
+For the reasons explained above this option is turned on by default.
+
+since: mod_perl 1.99_10
=head1 Problems With Reloading Modules Which Do Not Declare Their Package Name
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-cvs-help@perl.apache.org