open FILE "oklist";
$i = 0;
foreach (<FILE>) {
s/\r//g;
s/\n//g;
$oklists[$i] = $_;
$i++;
}
close FILE;
foreach (<STDIN>) {
exit if ($_ eq "EOF"); #違うか?
@stuff = split /\x20/, $_;
if (($stuff[2] eq "+") && ($stuff[3] eq "0001") && oklist($stuff[1])){
#DB書き込み $stuff[4]が操作対象
}
print $_;
}
sub oklist{
my $str = shift;
my $ret;
my $i;
my $sp;
@sp = split /\x3A/, $str;
$ret = 0;
for($i = 0; $i < @oklists; $i++){
if ($oklists[$i] eq $sp[0]){$ret = 1;last;}
}
return $ret;
}
(^^;