Subject: | New Warnings in CGI 3.08 |
I got these warnings when starting up Apache with RT under mod_perl 1.29.
Starting apache web server: Use of uninitialized value in numeric eq (==) at /usr/local/lib/perl5/5.8.5/CGI.pm line 182, <DATA> line 273.
Use of uninitialized value in numeric eq (==) at /usr/local/lib/perl5/5.8.5/CGI/Cookie.pm line 26.
Here's a patch to fix it (with much spanking to Geoff Young ;-)):
diff -Naur CGI.pm-3.08.old/CGI/Cookie.pm CGI.pm-3.08/CGI/Cookie.pm
--- CGI.pm-3.08.old/CGI/Cookie.pm Thu Apr 21 09:54:51 2005
+++ CGI.pm-3.08/CGI/Cookie.pm Thu Apr 21 09:55:57 2005
@@ -23,7 +23,7 @@
# Turn on special checking for Doug MacEachern's modperl
my $MOD_PERL = 0;
if (exists $ENV{MOD_PERL}) {
- if ($ENV{MOD_PERL_API_VERSION} == 2) {
+ if (exists $ENV{MOD_PERL_API_VERSION} && $ENV{MOD_PERL_API_VERSION} == 2) {
$MOD_PERL = 2;
require Apache2::RequestUtil;
require APR::Table;
diff -Naur CGI.pm-3.08.old/CGI.pm CGI.pm-3.08/CGI.pm
--- CGI.pm-3.08.old/CGI.pm Thu Apr 21 09:54:51 2005
+++ CGI.pm-3.08/CGI.pm Thu Apr 21 09:55:29 2005
@@ -179,7 +179,7 @@
if (exists $ENV{MOD_PERL}) {
# mod_perl handlers may run system() on scripts using CGI.pm;
# Make sure so we don't get fooled by inherited $ENV{MOD_PERL}
- if ($ENV{MOD_PERL_API_VERSION} == 2) {
+ if (exists $ENV{MOD_PERL_API_VERSION} && $ENV{MOD_PERL_API_VERSION} == 2) {
$MOD_PERL = 2;
require Apache2::Response;
require Apache2::RequestRec;