Ronald Schmidt ([EMAIL PROTECTED]) said something to this effect:
> The full warning message on our system (Solaris, Apache 1.3.3, mod_perl
> 1.21?, perl 5.005_02) is:
> 
> [Tue Jun 13 17:37:25 2000] null: Use of uninitialized value at
> /usr/local/lib/perl5/5.00502/CGI/Cookie.pm line 70.
> 
> We are porting perl/cgi scripts to run under Apache;:Registry and in the
> process of porting I am getting the warning above from one of the scripts.
> In investigating the problem I went to
> http://perl.apache.org/guide/porting.html to look for examples of cookie use
> with mod_perl.  I found that with slight modification to one of the samples
> I could re-produce the problem.  The modification involved moving the
> initialization of a CGI object reference out of a subroutine.  Initializing
> our $q = new CGI; in a subroutine would mean re-arranging a fair amount of
> code in our scripts.  Has anyone hit this before? Does anyone have a
> suggestion for getting around the problem?  The code that reproduces the
> problem follows.
> 
> Ronald Schmidt

I always find it easier to parse the cookies myself, rather than rely on
{Apache,CGI}::Cookie. I use something like:

    my %cookies = map { $1 => $2 if (/([^=]+)=(.*)/) }
                  grep !/^$/, split /;\s*/,$r->header_in('cookie');

and then %cookies has the names as keys, and the values as values. Creating
cookies is a matter; I usually join vars on '; '.

I would try using this method to fetch the cookies, and then dump them
to STDERR and see what you have. I have found that browsers can mangle
cookies, and then of course no cookie parsing module will help.

darren

-- 
Wise people think all they say; fools say all they think.

Reply via email to