Try this:
perldoc CGI.pm
/HTTP COOKIES
match should be ~ line 2600... its a good starting place! If you want a good book just on cookies (not perl specific), I can recommend "Cookies" by Simon St. Laurence, ISBN: 0 07 05098 9, or
this cookie FAQ at Cookie Central. The FAQ ranges from "What is a cookie" to "How to set and collect Cookies". For the basic nuts and bolts,
Netscape has a page too.
#!/home/bbq/bin/perl
# Trust no1!