Subject: | CGI::Carp has same problem with MOD_PERL_API_VERSION as CGI::Cookie as fixed in 3.11 |
While running CGI-3.11 with mod_perl 1.29 on Apache 1.3.34 I was seeing this error in the apache logs:
Can't locate Apache2/RequestRec.pm in @INC ... at /usr/local/lib/perl5/5.8.5/CGI/Carp.pm line 471.
I found in the changes listed for CGI v3.11 that this had been fixed in CGI::Cookie. The same fix needs to be applied to CGI::Carp. Attached is the diff file for patching CGI/Carp.pm.
*** /usr/local/lib/perl5/5.8.5/CGI/Carp.pm Sat Nov 5 20:05:08 2005
--- /usr/local/lib/perl5/5.8.5/CGI/Carp.pm.new Mon Nov 7 10:19:42 2005
***************
*** 466,472 ****
if ($mod_perl) {
my $r;
! if ($ENV{MOD_PERL_API_VERSION}) {
$mod_perl = 2;
require Apache2::RequestRec;
require Apache2::RequestIO;
--- 466,472 ----
if ($mod_perl) {
my $r;
! if (exists $ENV{MOD_PERL_API_VERSION} && $ENV{MOD_PERL_API_VERSION} == 2) {
$mod_perl = 2;
require Apache2::RequestRec;
require Apache2::RequestIO;