gozer       2004/09/09 15:16:39

  Modified:    src/docs/2.0/api/Apache Reload.pod
               src/docs/2.0/api/ModPerl Util.pod
  Log:
  Added ModPerl::Util::unload_package() to remove a loaded package
  as thoroughly as possible by clearing it's stash.
  
  Revision  Changes    Path
  1.13      +0 -25     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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Reload.pod        9 Sep 2004 18:43:45 -0000       1.12
  +++ Reload.pod        9 Sep 2004 22:16:39 -0000       1.13
  @@ -19,7 +19,6 @@
     PerlSetVar ReloadAll Off
     PerlSetVar ReloadModules "ModPerl::* Apache::*"
     #PerlSetVar ReloadDebug On
  -  #PerlSetVar ReloadConstantRedefineWarnings Off
     
     # Reload a single module from within itself:
     package My::Apache::Module;
  @@ -197,30 +196,6 @@
   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 Caveats
   
  
  
  
  1.11      +34 -0     modperl-docs/src/docs/2.0/api/ModPerl/Util.pod
  
  Index: Util.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/ModPerl/Util.pod,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Util.pod  25 Aug 2004 21:51:27 -0000      1.10
  +++ Util.pod  9 Sep 2004 22:16:39 -0000       1.11
  @@ -17,6 +17,9 @@
     
     # untaint a string (do not use it! see the doc)
     ModPerl::Util::untaint($string);
  +  
  +  # removes a module as best as it can
  +  ModPerl::Util::unload_module($module);
   
   
   
  @@ -153,6 +156,37 @@
   
   Do not use this function unless you know what you are doing. To learn
   how to properly untaint variables refer to the I<perlsec> manpage.
  +
  +
  +
  +
  +
  +=head2 C<unload_module>
  +
  +Unloads a module from the current perl interpreter in the safest
  +way possible.
  +
  +  ModPerl::Util::unload_module($module);
  +
  +=over 4
  +
  +=item arg1: C<$module> (scalar)
  +
  +The name of the module to unload
  +
  +=item ret: no return value
  +
  +=item since 1.99_17
  +
  +=back
  +
  +Unloading a module from Perl is a complicated business. This function 
  +tries very hard to do the right thing. After calling this module, it
  +should be safe to C<use> a new version of the module.
  +
  +References to module elements (function, variables, etc) that were taken
  +from outside the unloaded module will still be valid.
  +
   
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to