[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    AW: Can't locate object method "new" via package "CGI::Cookie"
From:       "Andreas Mock" <andreas.mock () web ! de>
Date:       2020-05-31 19:17:28
Message-ID: 001901d63780$20109eb0$6031dc10$ () web ! de
[Download RAW message or body]

Hi Vincent,

I don't have Debian. Therefor just a view hints.

1) CGI::Cookie loading is done sometimes dynamically via require. E.g. in
CGI.pm itself.
2) mod_perl 1/2 with the helper modules Apache2::RequestUtil interact
dynamically.
3) It can be possible that you have a version clash (alone or in combination
with other modules). Probably there was once pulled a module in your older
server which hinders the same behaviour.

Tests:
perl -MCGI::Cookie -E'say CGI::Cookie->VERSION'
perl -MApache2::RequestUtil -E'say Apache2::RequestUtil->VERSION'

On the other hand you can add debug code just before line
/home/lib/Marica/Base/login.pm line 198
to inspect the %INC hash to see whether CGI::Cookie was loaded somewhere.

You can also find the file Cookie.pm in your include path and put a
print STDERR map { "$_\n" } caller;
into it to find the location in Apache error log where it gets loaded in
the module stack.

Best regards
Andreas


-----Ursprüngliche Nachricht-----
Von: Vincent Veyron <vv.lists@wanadoo.fr> 
Gesendet: Sonntag, 31. Mai 2020 20:50
An: modperl@perl.apache.org
Betreff: Can't locate object method "new" via package "CGI::Cookie"

Hi List,

I have two servers using mod_perl, both having the same modules installed
and enabled; server1 got a fresh install of Debian Buster, while server2 was
upgraded to Buster from Stretch.

This code :
	my $cookie = CGI::Cookie->new(-name  => 'session',
 				      -value => $session_id,
				      -domain => $hostname
	    ) ;

generates the following error on server2 :

[Sun May 31 19:54:03.053725 2020] [perl:error] [pid 30663] [client
83.113.48.133:59196] Can't locate object method "new" via package
"CGI::Cookie" (perhaps you forgot to load "CGI::Cookie"?) at
/home/lib/Marica/Base/login.pm line 198.\n, referer:
https://marica.fr/site/abonnes/index.html

It works fine if add "use CGI::Cookie" to my module. 

What could be the reason why it works on server1 without "use CGI::Cookie"
and not on server2?

-- 
https://compta.libremen.com
Logiciel libre de comptabilité générale en partie double

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic