#!/usr/bin/perl -w use strict; use CGI; use CGI ':standard'; use CGI::Carp qw/fatalsToBrowser /; my $q = CGI->new(); my $url="http://www.xxxxx.com/xxx/xxx/"; my $path_to_text="/home/xxxxx/www/xxx/xxx/body.txt"; my $this_script_url="http://www.xxxxxx.com/cgi-bin/xxxxx.cgi"; my $post_number; my @updated_text; $/="\n\n\n"; #set the input Record seperator to a triple newline if ( $q->param() ) { #if params are not undef # ignore deleted next if ( $q->param("box$post_number") ); # keep the rest s/"/"/g; s/'/'/g; push @updated_text, $_; # now update file open(FH,">$path_to_text") || die $!; print FH join "\n\n\n", @updated_text; close(FH); print "Location: $url\n\n"; } else { #if params are undef open (FH, "$path_to_text") or die "where's the damn file? : $!"; print "Content-type: text/html\n\n"; print qq|