#!/usr/bin/perl -w use CGI::Cookie; use CGI qw/:standard *table *Tr *td/; %cookies = fetch CGI::Cookie; if($cookies{'TestMyCookie'}){ print header, start_html (-title=>'Getting Your Cookie'), p({-align=>center},$cookies{'TestMyCookie'}->value), h1({-align=>center},b('Your Cookie')), p({-align=>center},"Cookie: ",$cookies{'TestMyCookie'}),br; exit; } else{ $cookie = new CGI::Cookie( -name => 'TestMyCookie', -value => 'Vote', -expires => '+3M', -path => '/Music/test', -domain => 'rob-campbell.com'); print "Set-Cookie: $cookie", header, start_html(-title=>'Your Cookie Is Set'), redirect('cookie.cgi'); }