#!/usr/bin/perl print "Content-type: text/html\n\n"; & read_input; $bad_ip = $FORM{'banip'} ; unless ($bad_ip =~ /^\d+.\d+.\d+.\d+$/) { print "That IP looks Invalid!"; print"

\n"; print "
Go Back and Try Again
"; exit; } unless (-e "ip.txt") {print "There are no banned IP's
"; exit; } open (IP, "; close (IP); open (IP, ">ip.txt"); foreach $_(@ip) { chomp $_; if (/$bad_ip/) {next}; chomp$_; print IP "$_\n"; close (IP); } print "All Done!
"; print"

\n"; print "
Back to the menu here"; sub read_input { if ($ENV{'REQUEST_METHOD'} eq 'POST') { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } else { $buffer = $ENV{'QUERY_STRING'}; } @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $name =~ tr/+/ /; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } }