perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: What the...grrrrrrrr? Global symbol "$bdbh" requires explicit package
Date Wed, 07 May 2003 02:52:44 GMT
Martin Moss wrote:
> Hi everyone,
> 
> I'm suffering from a quirky problem.
> If I start apache from the command line (as root) with :-
> /etc/init.d/apache_mymodperllink start
> 
> my apache server starts fine and I have no issues.
> 
> However when I added this to my startup scripts so the above script would be
> called on run levels 3,4,& 5 and then rebooted, I get the following errors:-
> Global symbol "$bdbh" requires explicit package name at
> /home/mydir.prj/perllib//MyModule/Apache/Request.pm line 118
> One point to note is I'm pre-loading a load of modules dynamically using a
> require, rather than a 'use'.

Why don't you fix that problem, by defining that symbol? Or do you import it?
or do you have some class that optionally turns the strict pragma on?

Remember that require happens at runtime, whereas use at compile time. So may 
be moving all your requires into a BEGIN {} block will resolve the problem, or 
using:

use Foo ();

which is the exact equivalent of:

require Foo;

but again happens at compile time.

Without seeing the relevant code it's hard to know what the problem is.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Mime
View raw message