Here's what I use for problems like this:
Code:
$mystuff= $formdata{'mine'};
$inputstuff = $formdata{'inputtext'};
open (LOG, "stuff.txt") || &ErrorMessage;
@data = <LOG>;
close (LOG);
open (LOG, ">stuff.txt") || &ErrorMessage;
print LOG "String or whatever to write to the top of the file";
foreach (@data) {
print LOG $_;
}
close(LOG);
Mzzl, Chris