Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: One liner to read all cookie key/vals into a Hash...

by smullis (Pilgrim)
on Nov 08, 2004 at 11:30 UTC ( #406029=note: print w/ replies, xml ) Need Help??


in reply to Re: One liner to read all cookie key/vals into a Hash...
in thread One liner to read all cookie key/vals into a Hash...

Aha...

$q is my query object (I'm using CGI.pm in an OO style.)

e.g

# Set up Pragmas + external modules use strict; use warnings; use Data::Dumper; use CGI qw(:standard); my $q = new CGI; print $q->header; print "Hello World!\n"; my $cookie_name = "whatever you wanna call it"; my %cookie_hash = (map { split /=/, $_ } $q->cookie('$cookie_name')); +# print Dumper \%cookie_hash; print $q->end_html;

Cheers

SM


Comment on Re^2: One liner to read all cookie key/vals into a Hash...
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://406029]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (16)
As of 2014-09-23 12:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (221 votes), past polls