sub CheckRejectList { local($remoteAddress, $candidate); $remoteAddress = $ENV{'REMOTE_ADDR'}; if (!$remoteAddress) { #Can't get the address return 0; } if (!open(LIST, "forbidden.txt")) { #Bad news -- can't access the list return 0; } while ($candidate = ) { chop $candidate; if ($remoteAddress eq $candidate) { print "Content-type: text/html\n\n"; print "\n"; print "Access Forbidden\n"; print "\n"; print "\n"; print "

Access Forbidden

\n"; print "Access to this program from your IP address\n"; print "is forbidden due to abusive actions on the\n"; print "part of a user at that address.\n"; print "\n"; #Exit prematurely close LIST; exit 0; } } #All is well, return normally close LIST; }