You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jim Serio <ji...@rollercoaster.com> on 2000/07/19 04:10:07 UTC

Subroutine redefined errors at startup

I'm running Perl 5.6 and recently re-compiled Apache 1.3.12 and mod_perl 1.24
and I'm not getting various redefined errors at startup that I never got 
before. I've
also made no changes to my startup file or httpd.conf. Here's a few of the 
errors:

-----
Subroutine handler redefined at 
/usr/local/lib/perl5/site_perl/5.6.0/i686-linux/Apache/Registry.pm line 27.
Subroutine compile redefined at 
/usr/local/lib/perl5/site_perl/5.6.0/i686-linux/Apache/Registry.pm line 173.
-----

They seem to be focused on Registry and DBI. When I remove the startup.pl
file from httpd.conf, I get no errors.

Here's the cgi-perl section of httpd.conf:

-----
<Location /cgi-perl/>
         SetHandler perl-script
         PerlModule Apache::Registry
         PerlHandler Apache::Registry::handler
         PerlModule Apache::DBI
         PerlInitHandler Apache::StatINC
         Options ExecCGI
         PerlSendHeader On
</Location>
-----

Here's part of my startup.pl file:

-----
use Apache::Registry ();
use Apache::Constants ();
use Apache::Sandwich ();
use Apache::Include ();
use DBI ();
use Apache::DBI ();
-----

Should I not duplicate these modules and just have all of them in the
startup file?

Jim


Re: Subroutine redefined errors at startup

Posted by Carl Hansen <ca...@vividata.vividata.com>.
On Tue, Jul 18, 2000 at 07:10:07PM -0700, Jim Serio wrote:
> I'm running Perl 5.6 and recently re-compiled Apache 1.3.12 and mod_perl 1.24
> and I'm not getting various redefined errors at startup that I never got 
> before. I've
> also made no changes to my startup file or httpd.conf. Here's a few of the 
> errors:
> 
> -----
> Subroutine handler redefined at 
> /usr/local/lib/perl5/site_perl/5.6.0/i686-linux/Apache/Registry.pm line 27.
> Subroutine compile redefined at 
> /usr/local/lib/perl5/site_perl/5.6.0/i686-linux/Apache/Registry.pm line 173.
> -----
> 
> They seem to be focused on Registry and DBI. When I remove the startup.pl
> file from httpd.conf, I get no errors.
> 
> Here's the cgi-perl section of httpd.conf:
> 
> -----
> <Location /cgi-perl/>
>          SetHandler perl-script
>          PerlModule Apache::Registry
>          PerlHandler Apache::Registry::handler
>          PerlModule Apache::DBI
>          PerlInitHandler Apache::StatINC
>          Options ExecCGI
>          PerlSendHeader On
> </Location>
> -----
> 
> Here's part of my startup.pl file:
> 
> -----
> use Apache::Registry ();
> use Apache::Constants ();
> use Apache::Sandwich ();
> use Apache::Include ();
> use DBI ();
> use Apache::DBI ();
> -----
> 
> Should I not duplicate these modules and just have all of them in the
> startup file?
> 
> Jim
> 

from the ApacheDBI-0.87 README:
  " If you plan to use persistent database connections, there is only one thing
  to do: add the following configuration directive to conf/httpd.conf or to
  your startup.pl:
 
   PerlModule Apache::DBI    # this comes first !!
   ....                      # other modules using DBI
 
compare to your startup.pl.
might be relevant	


-- 
Carl Hansen
Pictopia.com, Inc.
carl@pictopia.com
510 841 6400 x 117



Re: Subroutine redefined errors at startup

Posted by Ken Williams <ke...@forum.swarthmore.edu>.
jim@rollercoaster.com (Jim Serio) wrote:
>Here's the cgi-perl section of httpd.conf:
>
>-----
><Location /cgi-perl/>
>         SetHandler perl-script
>         PerlModule Apache::Registry
>         PerlHandler Apache::Registry::handler
>         PerlModule Apache::DBI
>         PerlInitHandler Apache::StatINC
>         Options ExecCGI
>         PerlSendHeader On
></Location>
>-----
>
>Here's part of my startup.pl file:
>
>-----
>use Apache::Registry ();
>use Apache::Constants ();
>use Apache::Sandwich ();
>use Apache::Include ();
>use DBI ();
>use Apache::DBI ();
>-----
>
>Should I not duplicate these modules and just have all of them in the
>startup file?

Right.  The 'use' statements and 'PerlModule' directives are doing the
same thing, so you only need one or the other.  But it strikes me as odd
anyway that it's actually loading it twice though, because Perl should
see that it's in %INC and not try to load it again.  So there might
indeed be something fishy here, even though it's easily fixable.

By the way, 'PerlModule' directives are traditionally put at the top
level of the config file, outside any directive blocks.  They always
affect the global server anyway, not just the config section they're in.
So it's a bit misleading to put them in a config section.


  -------------------                            -------------------
  Ken Williams                             Last Bastion of Euclidity
  ken@forum.swarthmore.edu                            The Math Forum