Apache-Blog
view release on metacpan or search on metacpan
$r->log_reason("Can't create $comment_dir: $!");
return SERVER_ERROR;
} # end mkdir
} # end no directory
# need a filename. we start at 1 and move upwards. there's
# almost certainly a race condition here, but this is written
# for my site where i get about one comment a week. if yours is
# so busy you're worried about this breaking, then feel free to
# fix it.
my @existing_files = glob("$comment_dir/*");
my $new_basename = scalar(@existing_files) + 1;
open (COMMENT, ">$comment_dir/$new_basename");
print COMMENT "$name\n";
print COMMENT scalar(localtime)."\n";
print COMMENT $comment;
close COMMENT;
# not quite sure what this will do if the user is being a bitch
# and have proxied away the referer header. this could be
( run in 0.793 second using v1.01-cache-2.11-cpan-1d5ca39e368 )