in reply to Count script

Some preliminary points:

  1. For future reference, please read Writeup Formatting Tips and enclose your code in <code>...</code> tags.
  2. I don’t know of any Perl command named errexit?
  3. flock is for preserving data integrity in a multithreaded environment. It is not a tool for enforcing security by locking users out. (You may well be on top of this, but from the question asked and the snippet given, it’s hard to be sure.)
  4. Please don’t give your email address, or request private correspondence. That’s not how the Monastery works. Once a thread is started, the discussion is available for everyone to read — and benefit from.

Now to the question. Create a hash, say %ip, and update it each time a visitor attempts to verify an account number:

++$ip{$ip_address};

Then grant access or not, as follows:

if ($ip{$ip_address} < 4) { # Grant access } else { # Show an error message }

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,