in reply to cookies n variables

The Synopsis of CGI::Cookie has an example.

Cookies are a bit like hashes, in that there is a name and a value. Beware, though. You must first set a cookie in a response to a browser request. You cannot read the cookie until the browser makes subsequent requests, and then only if the browser accepted the cookie.