my $ripfile = $PATH . "内緒";
my (@IP, @IIP, $TIP);
if($FORM{'subject'} ne ""){
#スレッド立てすぎチェック
my (@IP, @IIP, @ZIP, $TIP, $VIP, $SIP, $JIP, $HIP);
$TIP = $HOST;
$TIP =~ s/<(.*)>//g;
$VIP = $TIP;
if($FLAG == 5){
$TIP = $FORM{'sid'};
$TIP =~ s/\W/\\$&/g;
}else{
my @ippart = split(/\./, $TIP);
$JIP = $ippart[0];
if($TIP !~ /[a-zA-Z]/o){
$TIP =~ s/[0-9]+$//o;
$TIP = "^" . $TIP;
}elsif($JIP =~ /[x\-\.\d]{12}/o){
$TIP =~ s/([x\-\.\d]{5})([x\-\.\d]*)/$1\.\*/o;
}elsif($JIP =~ /\d{8}/o){
$TIP =~ s/(\d{3})(\d*)/$1\.\*/o;
}else{
if(@ippart < 5){
$TIP =~ s/\d+/\.\*/g;
}else{
if(($ippart[@ippart-6] =~ tr/\d/$&/) > 4){
$TIP = $ippart[@ippart-6];
$TIP =~ s/\d.*/\.\*/g;
}else{
$TIP = "";
}
$TIP .= "$ippart[@ippart-5].$ippart[@ippart-4]";
$TIP =~ s/\d+/\.\*/g;
$TIP .= ".$ippart[@ippart-3].$ippart[@ippart-2].$ippart[@ippart-1]";
}
}
$HIP = "$ippart[@ippart-3].$ippart[@ippart-2].$ippart[@ippart-1]";
}
# 書き込みログファイル
open(RIP,"<$ripfile");
@ZIP = <RIP>;
close(RIP);
# 書き込みホスト保存
open(WIP,">$ripfile");
#flock(WIP,2);
print WIP ("$HOST,$FORM{'sid'},$FORM{'key'}\n", @ZIP)[0..$SETTING{'BBS_THREAD_TATESUGI'}-1];
close(WIP);
}