On Mon, 2003-06-02 at 09:05, cap wrote:
> i have an application that uses CGI and sets the cookie values as a hashref.
> im then attempting to retreive the values with Apache::Cookie with:
> 
> $cookies = Apache::Cookie->fetch;
> 
> $ccokies is a hashref so i should be able to get the individual values with:
> 
> $cookies->{uid};
> 
> right?  however, this doesn't appear to work.

I see the problem.  There is mistake in the Apache::Cookie
documentation, but the correct way to do this is shown in the mod_perl
guide:
http://perl.apache.org/docs/1.0/guide/porting.html#Converting_to_use_Apache_Perl_Modules

Change your last line to this:

my $uid = defined $cookies->{'uid'} ? $cookies->{'uid'}->value() :
undef;

- Perrin

Reply via email to