#!/usr/local/bin/perl

$holds = 7;
($sec,$min,$hour,$mday,$mon,$year,$wdy,$yday,$isdst)=gmtime(time+$holds*24*60*60);
@youbi=("Sun","Mon","Tue","Wed","Thr","Fri","Sat");
@month=("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
if ($year < 50) {$year+=2000};
$forCookie = sprintf("%s\,  %02d\-%s\-%04d  %02d:%02d:%02d GMT",$youbi[$wdy],$day,$month[$mon],$year,$hour,$min,$sec);

$agent=1;

print "Content-type: text/html\n";
print "Set-Cookie: count=$agent;expires=$forCookie\n\n";
print "<HTML>\n";
print "<TITLE>環境変数</title>\n";
print "<body>\n";
print "<h1>クッキーの書き込み</h1>\n";
print "<hr>\n";
print "Cookieの内容 ： $agent\n";
print "</body>\n";
print "</html>\n";
exit;
