Justin Luster wrote:

I know that when you “require” or “use” helper files in a Perl Script,
and you are using Apache::Registry, when changes are made to the helper
files they are not recognized until you restart Apache.  In the
documentation it says that you can change the Apache configuration file
to do this for you.

That's a reference to Apache::Reload or Apache::StatINC. You can do that in an htaccess file if your host allows it.

What I want to know is if there is a way to clear
out the files or code in the Apache::Registry cache via a Perl Script.

Yes, but understand that we're not talking about the Apache::Registry cache here. A::R just caches your CGI script itself, not the modules. The modules are cached as a normal function of Perl, i.e. once it has compiled a module that module stays in memory until the Perl process shuts down.

To make Perl reload a module, you can do this:

delete $INC{'Your/Module.pm'};
require Your::Module;

But that glosses over a lot of details about imports and such, so you're better off using Apache::Reload if you can.

- Perrin



Reply via email to