httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <>
Subject Re: preload modules at sever startup
Date Wed, 09 Feb 2005 17:45:46 GMT

Jim Martinez wrote:
> Hi,
> I'm looking for some suggestions for a library problem with Apache::Test,
> which I'm using to develop a web application.
> Hope this is the place to ask.

better now, but that list was just created yesterday :)

> Using Apache 1 and Mod perl 1, how can I preload perl modules at server
> startup?
> My contains something like this:
> PerlModule Foo::Bar
> <Location /a >
>   SetHandler perl-script
>   PerlHandler Foo::Bar::myhandler
> </Location>
> "make test" fails.  The apache server won't start because it can't find
> Foo::Bar, needed by the line "PerlModule Foo::Bar"

if you can move it to t/lib/Foo/ Apache-Test will pick it up.

> In the link below, I read about "PerlSwitches -I@ServerRoot@/../lib"
> Is PerlSwitches for MP2 only?

yes.  an equivalent in mp1 might be to do this in

  use lib qw(@ServerRoot@/../lib)

or without the <Perl> sections from, which is equivalent
to but with @var@ substitution.  you can use if
you don't need substitution.

keep in mind that if you go this route you will probably need to change to so that it is loaded _after_ your  see the bottom of the generated httpd.conf to see what I mean.

> In the link above I'd call the root development directory
> /path/to/Apache-Amazing, just so that you understand what I mean by root
> development directory.  Here is a listing of the root development
> directory:
> CVS/  Changes  MANIFEST  MANIFEST.OLD  MANIFEST_maybe  META.yml  Makefile  
> Makefile.PL  README  blib/  docs/  lib/  pm_to_blib  t/
> Of course Foo::Bar is in lib/Foo/ (until Apache::Test moves it to
> blib/ )
> If I set PERL5LIB to the root development directory, the "make test" runs
> fine (well it shows me my programming errors is what I mean).
> Should I create a file that does something like:
> BEGIN { use lib @ServerRoot@../lib }
> Then and add lines to to run
> Or is there a better way?  A hard coded path won't work in my situation
> (which is why I use the @ServerRoot@).

no, that's the idea.  you just need to use the magic files :)



View raw message