#! /usr/bin/perl print "Content-type: text/html\n\n" ; $_ = <> ; $_ =~ tr/+/ / ; $_ =~ s/%21/!/ ; for (split /&/) { ($name,$value) = split /=/ ; $cgidat{$name} = $value ; } print "adding '$cgidat{'bar'}' of length ".length($cgidat{'bar'}) ; # die ; open OUTFILE,'add2tome.txt' ; print "

here is what i have already:
" ; while () { chomp ; if ($_ eq $cgidat{'bar'}) { $seenflag = 1; print "seeing: $_\n" } print "$_\n" } close OUTFILE ; if ($seenflag) { print "
this line already exists in the file!\n" } else { open OUTFILE,'>>','add2tome.txt' ; print OUTFILE "$cgidat{'bar'}\n" ; } # die ; print "
" ; system("cat add2tome.txt")