use CGI; my $cgi = CGI->new(); my $cookie = $cgi->cookie( -name => $name, -value => $value, -path => "/", -expires => '-1d', ); print $cgi->header( -type => 'text/html', -cookie => $cookie, );