i need a perl code that will take a the input form my 1 question form (name) and print it on a new line with <br> after it in a text file (submit.txt) please can someone either write one up for me as simple as is posible or somthing, o and it has to be Appending so it adds it to the old data, i tried writing one but it failed miserably and my server told me to go find a person to do it for me so can anyone help??

Here's a simple bit of code I put together:


use strict;

use CGI qw(:standard);

my $query = new CGI;

my %vars;

foreach my $key (sort {$a <=> $b} $query->param())
	$vars{$key} = $query->param($key);

print "content-type: text/html\n\n";

if(open(FILE, ">>testFile.txt"))
	print FILE "$vars{'data'}<br>";
	print "Success";
	print "Fail";


This code assumes that you are wanting the information from the field named "data" saved in the file.

Here's a simple bit of code I put together:
thank you, that code will save me soo much time :!: :cheesy:

This question has already been answered. Start a new discussion instead.