if(open (my $filehandle, '<', '/home/cowpensv/public_html/cgi-bin/block.txt')) { my $comments = $FORM{'comments'}; my $is_blocked = 0; while ($is_blocked == 0 && (my $word = <$filehandle>)) { chomp $word; $is_blocked = 1 if index($comments, $word) > -1; } close $filehandle; if ( $is_blocked ) { print "Content-type: text/html\n\n"; print "Blocked\n"; print "

BLOCKED!!

\n"; print "\n\n"; exit; } } else { die "Can't open block.txt"; # or any other error-handling # i don't like die in a cgi-env }