Apache::Cookie seems to have two different interfaces...or maybe there
are two different distributions of Apache::Cookie? Whatever it is, the
interface seems different on two machines here at work. One has 5.004
and one has 5.005, but that shouldn't change the Apache::Cookie interface
should it?
The interfaces are totally different. One uses set() and get(), either
from an object or via Apache::Cookie->get(). The other purports to
use the CGI::Cookie interface but only accepts the methods it documents
itself: fetch(), bake(), etc.
In my code, I "use Apache::Cookie" and then bang away trying to figure
out what methods it supports. The result is that the code on machine1
that calls Apache::Cookie->get('mycookie') dies with an undefined
subroutine error when run on machine2 (and vise versa for code on
machine2 that uses fetch() and bake()).
What am I missing here? I've done "force install Apache::Cookie"
from the CPAN shell prompt several time to try to make sure everything
is in sync, but the discrepancy still exists, and I still don't know
what the correct interface to Apache::Cookie should be. My hunch is
that the get() and fetch() versions are completely separate modules
that both declare "package Apache::Cookie", but good old CPAN should
allow that, should it?
Can someone set me straight?
-John
P.S.-Documentation snippets from the two machines:
On machine 1:
% perldoc Apache::Cookie
NAME
The Apache::Cookie module - An OO interface to cookies based
on CGI::Cookie, for use in mod_perl Apache modules.
SYNOPSIS
use Apache::Cookie;
$r = Apache->request;
# Object oriented
$cookie = Apache::Cookie->new($r);
$cookie->set(-name => 'cookie', -value => 'monster');
$value = $cookie->get('cookie');
...
On machine 2:
% perldoc Apache::Cookie
NAME
Apache::Cookie - HTTP Cookies Class
SYNOPSIS
use Apache::Cookie ();
my $cookie = Apache::Cookie->new($r, ...);
DESCRIPTION
The Apache::Cookie module is a Perl interface to the cookie
routines in libapreq. The interface is based on Lincoln
Stein's CGI::Cookie module.
...