コピペで使おうなんて思わないほうが身の為です(笑)ブラウザーの右上×で閉じてください。
昨日と違う文字は一字だけ(*^^*ゞ

参考文献「すぐわかるperl」著者 深沢千尋

#!/usr/local/bin/perl
print "Content-type: text/html\n\n";

read(STDIN, $str, $ENV{"CONTENT_LENGTH"});
@nakami = split('&', $str);
foreach(@parts) {
($variable, $value) = split("=");
$value =~ tr/+/ /;
$value =~ s/%([0-9a-fA-F][0-9a-fA-F])/pack("C", hex($1))/eg;
$value =~ s/\r\n/\n/g;
$value =~ s/\r/\n/g;
$cgi{$variable} = $value;
}
$formfile = "../chatform.html";
$name = $cgi{'name'};
$memo = $cgi{'memo'};
print <<EOF;
<META HTTP-EQUIV="Refresh" CONTENT="5;URL=http://****/~****/chatform.html">
<BODY>
wait for...<p>
EOF
open(FILE, "$formfile");
@oldform = <FILE>;
close(FILE);


$li = undef;
foreach(@syuunou) {
if(/^<LI>/) {
@body = (@body, $_);
$li = 1;
} elsif ($li) {
@foot = (@foot, $_);
} else {
@head = (@head, $_);
}
}

open(FILE, ">$formfile");
select FILE;
print @head;
print @body;
print <<EOF;
<LI>$name: $memo
EOF
print @foot;
close(FILE);