I go with you in a dev environment still it decreases performance so on a production server where modules should not change every minute I never use it.

Nevertheless I don't know exactly how Apache::Reload is working but I suppose it deletes the module in %INC and reloads it using perls standard methods which is much wiser so one can import vars from the modules into its own namespace, syntax checking is done ...

Tom

Thomas Klausner wrote:
Hi!

On Fri, Feb 27, 2004 at 09:35:11AM +0000, Mark Maunder wrote:


In a perl handler, I'm doing a stat on a module file, and if the file
has been modified, I'm reloading the module by slurping the file into a
scalar and eval'ing it. The module has a few subs and global vars that
have defaults set on initialization. I have about 20 modules I'm doing
this with (all subclasses of a parent generic module). I'm assuming the
subs will be overwritten in the module namespace, and global vars
re-initialized with their default values. All instances of objects created from these modules/classes are
destroyed at the end of each request, and this reload happens at the
beginning of a request before objects are instantiated.


Anything wrong with doing this? It seems a little too easy! :)


It might even be easier:
use Apache::Reload;




--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to