views:

166

answers:

2

I am using mod_perl for web development. I do not want to restart mod_perl every time I modify a Perl module.

I came across solution about Apache::Reload.

I install this module from CPAN, modify httpd.conf accordingly & add "use Apache::Reload" at my perl module, as stated in documentation.

I tried the reload all module method, & reload specific module when touch file. But both fail to work at all.

May I know is there any other mod_perl configuration that will prevent this from working? Or any other factor?

A: 

Consider writing your app using Plack, either directly or via one of the frameworks that have PSGI drivers. Then, when you're debugging, use the plackup tool like so:

$ plackup --server Apache2 -r --app /path/to/your_app.psgi

The plackup documentation has more details one how the .psgi file should look, and your framework's documentation should help too. Here's an example using Catalyst::Engine::PSGI

# app.psgi
use strict;
use MyApp;

MyApp->setup_engine('PSGI');
my $app = sub { MyApp->run(@_) };
Piers Cawley
A: 

I use this solution, from Perrin Harkins via PerlMonks:

"Set MaxRequestsPerChild to 1, then load any potentially-changing modules in the child, not the parent (obviously only for development environments). Each request will hit a fresh child server, which will load all of your potentially-changing modules anew."

From "A better way to see module changes in a running web server" - http://www.perlmonks.org/bare/?node_id=794860

gigawatt