END
# 発言ならデータファイルに追加
if ( $from ne '' && $message ne '' ){
($sec,$min,$hour,$day,$mon,$year) = localtime(time());
$year += 1900;
$mon++;
$now_date = sprintf("%d/%02d/%02d %02d:%02d:%02d",
$year,$mon,$day,$hour,$min,$sec);
if ( $ENV{REMOTE_HOST} =~ m/^[\d\.]+$/ ){
$host = $ENV{REMOTE_HOST};
} else {
$host = gethostbyaddr(pack('C4',split(/\./,$ENV{REMOTE_ADDR})),2)
|| $ENV{REMOTE_ADDR};
}
open(OUT,">> $data_file");
print OUT "発言者: $from
\n";
print OUT "$now_date $host
\n";
print OUT "$message
\n";
close(OUT);
}
# データファイル内容を表示
open(IN,"$data_file");
print
;
close(IN);
print <