[Chicago-talk] mod-perl dynamic recompile

Jay Strauss me at heyjay.com
Sun Aug 21 11:56:34 PDT 2011


I'm running in a simple mod-perl 2 env.  My script (chart.pl in
/var/www/MarketData) I run from mod-perl "use"s a package outside my
apache2 tree.  I want to be able to edit and change the package (that
is "use"d) and have Apache recompile the package on the fly like it
does for the chart.pl script.  But I'm not sure what to do.

(I've been googling but can not get it to work)
(I've tired putting a startup.pl but my server fails to start with the

I'm hoping someone here can spot what I'm doing wrong.  I'm not seeing it.

Any help is appreciated

I'm running on Ubuntu. so here are the relevant bits:

root at black:/etc/apache2# cat sites-enabled/
        Alias /MarketData/ /var/www/MarketData/
        <Location /MarketData/>
                SetHandler perl-script
                PerlResponseHandler ModPerl::Registry
                PerlOptions +ParseHeaders
                Options +ExecCGI
                Order allow,deny
                Allow from all

root at black:/etc/apache2# cat conf.d/mod_perl
PerlPostConfigRequire /home/jstrauss/perl/startup.pl

root at black:/etc/apache2# cat /home/jstrauss/perl/startup.pl
use lib "/home/jstrauss/perl/MarketData-Historic-Yahoo/lib";

# cat /var/www/MarketData/chart.pl
use 5.010;
use CGI;

use strict;
use warnings;

use lib '/home/jstrauss/perl/MarketData-Historic-Yahoo/lib';

use MarketData::Historic::Yahoo qw(:all);

my $q = CGI->new();
say $q->header(), $q->start_html();

say "<h1>Parameters</h1>";

More information about the Chicago-talk mailing list