Hi again,

On Sun, 25 Jun 2000, My Alias wrote:

> I really am not sure what I've got (mod_perl
> or Apache::Registry).  :)

Looking at what you have below, anything from <Location "/db-bin"> is
configured to be served by mod_perl which in turn calls a Perl handler
in Apache::Registry (.../Apache/Registry.pm) which in its turn runs
your Perl scripts in db-bin if it can.  If you commented that bit out
and uncommented the other bit then Apache would still tell mod_perl to
serve things from that <Location> but mod_perl would then be looking
for a subroutine called `handler' in a module called `Footer.pm' in
`.../Apache'.  I don't know what the `...' is because I can't see that
bit of the config - if it's there.  If it isn't there then Apache
won't know what to do about it.  You need something that tells Perl
where to look for your modules.  There can be several places.  It's
in the Guide.

> Actually, I have in the httpd.conf file the following:
> 
>   Alias /db-bin/ "/home/httpd/db-bin/"
>   <Location "/db-bin">                   <-- These bits tell Apache that
>     SetHandler      perl-script          <-- mod_perl is the handler and
>     PerlHandler     Apache::Registry <-- This bit tells mod_perl that it is
>     PerlSendHeader  On               to run sub handler in Apache/Registry.pm
>     Options         +ExecCGI 
>   </Location>
> 
> # <Location "/db-bin">                   <-- These bits tell Apache that
> #   SetHandler      perl-script          <-- mod_perl is the handler and
> #   PerlHandler     Apache::Footer   <-- This bit tells mod_perl that it is
> # </Location>                        to run sub handler in Apache/Footer.pm

You don't want both the bits above in the config file and uncommented.
They would give conflicting information to mod_perl about what is to
handle requests for resources from that Location.  It's a little bit
confusing that there are apparently two handlers.  The real handler as
far as Apache is concerned in a mod_perl system is in mod_perl.c which
Doug wrote.  But its job is just to pass control to a Perl subroutine
which you wrote.  By convention it is called `handler' but you can in
fact choose a different name if you tell mod_perl in the config.
Don't bother unless you have a good reason (like understanding what
the dickens is going on:).

> Specifically, the only module i've tried so far is the
> Footer.pm, and it in fact was installed into:
> /usr/local/apache/lib/perl/Apache.

Try putting 

use lib "/usr/local/apache/lib/perl/Apache";
print STDERR "Running startup.pl\n";

in the BEGIN block of your startup.pl so that you know it's getting
compiled.  

> I'm in the process of trying to understand why my "stuff" fails
> under "use strict;" (vars, redefined subroutines, etc.)

That a whole different can of worms.  You need to understand what the
symbol table is, what a package is, and the difference between normal
Perl variables and lexically scoped variables.  Amongst other things.
Way Off Topic for this list but mail me privately if you don't mind
waiting for your replies - I get a lot of mail and I'm very busy.

73,
Ged.

Reply via email to