in reply to Blocking based on words in a list

Of course, you don't want to be using a single, hardcoded file name. If someone else submits a comment at the same time, your block.txt will get overwritten, avoiding your scan. Look into File::Temp.

Updated: (repeating messaged clarification for the benefit of others) The problem isn't with the code you've shown. Suppose I click submit. Your code dumps my comment into block.txt. Before the file is read in by your scanner, someone else submits a comment. Now your scanner checks block.txt, but not MY block.txt. Depending on how the rest of your code works, my comment is either dropped (bad) or not scanned (also bad).


The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon

Replies are listed 'Best First'.
Re^2: Blocking based on words in a list
by esskar (Deacon) on Dec 29, 2005 at 09:21 UTC
    why is that? block.txt will be opened for reading, not for writing!?!