Subject: | Can't call method "pool" on unblessed reference at /usr/lib/perl5/site_perl/5.10.0/CGI/Simple.pm line 235. |
Date: | Thu, 5 May 2011 11:58:18 +0300 |
To: | bug-CGI-Simple [...] rt.cpan.org |
From: | Gabor Szabo <szabgab [...] gmail.com> |
Using CGI::Simple in mod_perl environment if I have a call like this:
my $q = CGI::Simple->new({ x => 42 });
I get an exception:
Can't call method "pool" on unblessed reference at
/usr/lib/perl5/site_perl/5.10.0/CGI/Simple.pm line 235.
A workaround would be:
{
no warnings;
sub CGI::Simple::_mod_perl { };
$q = CGI::Simple->new({ x => 42 });
}
or also:
{
local *{CGI::Simple::_mod_perl} = sub {};
$q = CGI::Simple->new({ x => 42 });
}
and in perl 5.12 probably this would also work:
{
local delete $ENV{MOD_PERL};
local delete $ENV{GATEWAY_INTERFACE};
$q = CGI::Simple->new({ x => 42 });
}
but I have not tested this.
I am not sure how to write a unit test for this case and how to really
fix it in the code of CGI::Simple.
Using CGI::Simple 1.113 on perl 5.10 SUSE Linux
Gabor