#!/usr/local/bin/perl
require 'cgi-lib.pl'; &ReadParse(); $name=$in{"name"}; $com=$in{"com"}; |
if($name ne "" or $com ne ""){ open(NEW,">new.txt"); # flock(NEW,2); if($name ne ""){print NEW "お名前:$name<br>\n";} else{print NEW "匿名さん<br>\n";} if($com ne ""){print NEW "メッセージ:$com<p><hr>\n";} else{print NEW "こんにちは。<p>\n";} open(IN,"keiji.txt"); # flock(IN,2); while($data=<IN>){print NEW $data;} close(IN); close(NEW); rename("new.txt","keiji.txt"); # flock(IN,8); # flock(NEW,8); } |