Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Hashes and Cookies (or more to the point, strings)

by mikeB (Friar)
on Jul 19, 2001 at 19:32 UTC ( #98113=note: print w/replies, xml ) Need Help??


in reply to Hashes and Cookies (or more to the point, strings)

You are correct. You cannot (usefully) assign that string to a hash. What you need to do is split the string into individual items and assign them to the hash.

Fortunately, an array of key/value pairs can be assigned to a hash with the desired result. This often appears in code as

%hash = (key1 => value1, key2 => value2);
where the => operator is a pretty replacement for a comma.

In your specific case, you want to split() the cookie string on commas, and assign the resulting array to your hash variable. Check the perldocs for details :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2022-01-16 10:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (49 votes). Check out past polls.

    Notices?