joined:Jan 4, 2011
I have done my best in trying to find a way to be able to do the following using a Perl script (.pl)
I have a text file (data.txt) that I would like to add some info at the beginning of the file (prepend I believe, not append).
From what I have gathered, "append" adds to the "end" of a file. I need to add to the "beginning" of a file after a form submission.
Any help would be appreciated, thank you.
Here is what I have so far:
use CGI ':standard';
open WRITE, "<data.txt";
# 'name' is what is taken from my submission form
$name = param('name');
print WRITE "$name\n";
print "Content-type: text/html\n\n";