> What is the difference between how a BEGIN block and an anonymous block
> in a module loaded into mod_perl?

It looks to me like you are confused about "our" and BEGIN.  If you change
the "our" to a "use vars" I think it will fix your problems.  This is not
mod_perl-specific.

> Are anonymous blocks in a module only read and executed when mod-perl
> first loads them, ie once?

The block in your example is not inside of a subroutine, so it will only be
called once when the module is loaded.

> Another problem is when I try to build a SELECT HTML element with a
> call to
> the CGI module. In my anonymous block all of a sudden the HTML form
> variables
> are no longer available with the CGI::param call.  Yet I can build the
> select element later in the cgi scripts using the same variables
> without a problem.

I'm guessing it's more scoping problems with "our."

> In a simpler line, should I have a use DBI() in startup.pl as well as
> the
> PerlModule Apache::DBI in httpd.conf?

You need to use both Apache::DBI and DBI somewhere.  Either place is fine.
I usually pull in lots of modules, so it's easier to do in startup.pl.

- Perrin


Reply via email to