costas has asked for the wisdom of the Perl Monks concerning the following question:

I am using this to retrieve values from a multiple cookie

my $cookie_value = fetch CGI::Cookie;
only problem is that that the results that it brings back appear like this

$cookie_value->{'name'} = name=value;path=\

I then have to perform split function to extract value.
how can you retrieve JUST the value in a hash set?

THanks

Replies are listed 'Best First'.
Re: cookie retrieval
by mpolo (Chaplain) on May 18, 2001 at 14:55 UTC
    You're reading the cookie into a scalar variable rather than a hash. If you change this to
    my %cookie_value=fetch CGI::Cookie;
    you will have it in a hash, so that $cookie_value{'name'} will indeed be equal to 'value'.

    So, in essence, one punctuation error was the difference between success and failure.

Re: cookie retrieval
by DrZaius (Monk) on May 18, 2001 at 20:25 UTC
    If you are 'use CGI; my $cgi = CGI->new'ing, you can do this instead:
    my $cookie_a = $cgi->cookie('a');