#!/usr/local/bin/perl

$cookie = $ENV{'HTTP_COOKIE'};
@array = split(/;/,$cookie);
foreach $tmp (@array){
	($key,$value)=split(/=/,$tmp);
	if($key eq 'p_count'){
		$count = $value;
	}
}

if( $count == ""){
	$count = 0;
}

$count++;
$expires_date = "Fri,31-dec-2002 00:00:00 GMT";

print "Content-type: text/html\n";
print "Set-cookie: p_count = $count; expires=$expires_date\n\n";
print "<HTML>\n";
print "<TITLE>かうんた</TITLE>\n";
print "<body>\n";
print "<H1>個人別かうんた</h1>\n<HR>";
print "あなたは$count回目の訪問です\n";
print "</body>\n";
print "</html>\n";
exit;
