http://qs321.pair.com?node_id=98113


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 :)