Subject: | undefined MOD_PERL_API_VERSION |
Apache::DBI 0.94
perl 5.8.7
apache 1.3.33
mod_perl 1.29
FreeBSD 5.4-RELEASE-p4
I get the following error upon starting Apache:
Use of uninitialized value in numeric eq (==) at /usr/local/lib/perl5/site_perl/5.8.7/Apache/DBI.pm line 211.
Use of uninitialized value in numeric eq (==) at /usr/local/lib/perl5/site_perl/5.8.7/Apache/DBI.pm line 35.
I've patched Apache::DBI a little to get rid of these. I just had to add a few "if exists $ENV{MOD_PERL_API_VERSION}".
As I can see someone already tried to fix 0.98 but a couple of lines still need to be patched.
The patch for Apache::DBI 0.98 follows:
--- DBI.pm.orig Fri Jul 1 04:00:12 2005
+++ DBI.pm Wed Jul 13 12:54:13 2005
@@ -32,7 +32,7 @@
sub connect_on_init {
# provide a handler which creates all connections during server startup
- if ($ENV{MOD_PERL_API_VERSION} == 2) {
+ if (exists $ENV{MOD_PERL_API_VERSION} && $ENV{MOD_PERL_API_VERSION} == 2) {
if (!@ChildConnect) {
require Apache2::ServerUtil;
my $s = Apache2::ServerUtil->server;
@@ -114,7 +114,7 @@
my $needCleanup = ($Idx =~ /AutoCommit[^\d]+0/) ? 1 : 0;
if(!$Rollback{$Idx} and $needCleanup and Apache->can('push_handlers')) {
print STDERR "$prefix push PerlCleanupHandler \n" if $Apache::DBI::DEBUG > 1;
- if ($ENV{MOD_PERL_API_VERSION} == 2) {
+ if (exists $ENV{MOD_PERL_API_VERSION} && $ENV{MOD_PERL_API_VERSION} == 2) {
require Apache2::ServerUtil;
my $s = Apache2::ServerUtil->server;
$s->push_handlers("PerlCleanupHandler", \&cleanup);
--- DBI.pm.orig Fri Jul 1 04:00:12 2005
+++ DBI.pm Wed Jul 13 12:54:13 2005
@@ -32,7 +32,7 @@
sub connect_on_init {
# provide a handler which creates all connections during server startup
- if ($ENV{MOD_PERL_API_VERSION} == 2) {
+ if (exists $ENV{MOD_PERL_API_VERSION} && $ENV{MOD_PERL_API_VERSION} == 2) {
if (!@ChildConnect) {
require Apache2::ServerUtil;
my $s = Apache2::ServerUtil->server;
@@ -114,7 +114,7 @@
my $needCleanup = ($Idx =~ /AutoCommit[^\d]+0/) ? 1 : 0;
if(!$Rollback{$Idx} and $needCleanup and Apache->can('push_handlers')) {
print STDERR "$prefix push PerlCleanupHandler \n" if $Apache::DBI::DEBUG > 1;
- if ($ENV{MOD_PERL_API_VERSION} == 2) {
+ if (exists $ENV{MOD_PERL_API_VERSION} && $ENV{MOD_PERL_API_VERSION} == 2) {
require Apache2::ServerUtil;
my $s = Apache2::ServerUtil->server;
$s->push_handlers("PerlCleanupHandler", \&cleanup);