Modperl::PerlRun Reload modules

Modperl::PerlRun Reload modules

am 08.08.2009 00:31:17 von kiran kumar

Hi,
I am working on migrating some legacy code from cgi to run under
Modperl::Perlrun. Perlrun reloads the cgi scripts for each requests
but the perl modules are still cached. We ran into an issue wherein
there were some modules that created closures and since these modules
were cached we could not run them under modperl::perlrun.

In the long run we would like to clean up these modules , for now we
want them to run under Perlrun without making any change to the
modules

I looked around to see if there was a way to reload specified modules
on each request but did not come across any way to do this.

I looked at the way Apache::Reload reloads modules and came up with a
way that seems to be reload the module each time .

# In httpd.conf
PerlCleanupHandler "sub { delete $INC{'Dirty.pm'};
ModPerl::Util::unload_package('Dirty'); require 'Dirty.pm'; }"

Am I missing something here or Is there a better way to reload the
required modules on each request under PerlRun.

Thanks ,
Kiran