SPUG: Newbie mod_perl q: When modules are loaded

Andrew Sweger andrew at sweger.net
Sat May 8 13:00:08 CDT 2004

On Fri, 7 May 2004, Dan Sanderson wrote:

> Kwiki's index.cgi loads modules by name from its configuration file:
> changes_class is set to "CGI::Kwiki::Changes".  Would this cause a
> specific problem for mod_perl, with or without the StatINC configuration?

I don't know of a specific problem, but I could see where 'use lib' will
not do what you might expect because things (and stuff) have been
precompiled and cached in memory. Especially if directories have changed
locations after they've been cached.

> Given that mod_perl doesn't reload modules with a high performance
> configuration, what's the best way to refresh the cache when new modules
> are deployed (presumably from a test instance to a production instance)?

Even for development with plain old Perl CGI scripts, I always recommend a
simple installation process that installs the files from where they're
being developed to their running locations on the system. Give developers
(yourself) necessary sudo permissions to have the install script or make
file restart Apache. If you aren't testing from known a starting point,
you're just going to give yourself fits chasing ghosts.

Andrew B. Sweger -- The great thing about multitasking is that several
                                things can go wrong at once.

More information about the spug-list mailing list