netroact
07-04-2006, 01:54 AM
I have a script that reads from a text file and populates a textarea for review. After any newlines or returns between paragraphs there is a whitespace displayed in the textarea. There isn't a leading whitespace in the text file. I can read from the same text file to an html file with no textarea, and it does not add a leading whitespace. Is there something about a textarea that causes it to add a leading whitespace?
Here is a relevant snippet from the code:
open (EDITDATA,"/home/user/public_html/cgi-bin/content.txt");
my @content = <EDITDATA>;
close (EDITDATA);
my $content = "@content";
$content =~ s/(<br>)?//g;
print <<EOF;
<table width="750" height="650" align="center" bgcolor="ffffff" cellspacing="0" cellpadding="0">
<tr>
<td width="750" height="650" align="center" bgcolor="f0f0f0" cellspacing="0" cellpadding="0">
<form method="POST" action="content.pl" ENCTYPE="multipart/form-data">
<br>
Content:<br>
<textarea name="content" rows="25" cols="60">$content</textarea>
<br>
<br>
<input type="submit" name="submit" value="Submit">
</form>
</td>
</tr>
</table>
EOF
Thanks!
Here is a relevant snippet from the code:
open (EDITDATA,"/home/user/public_html/cgi-bin/content.txt");
my @content = <EDITDATA>;
close (EDITDATA);
my $content = "@content";
$content =~ s/(<br>)?//g;
print <<EOF;
<table width="750" height="650" align="center" bgcolor="ffffff" cellspacing="0" cellpadding="0">
<tr>
<td width="750" height="650" align="center" bgcolor="f0f0f0" cellspacing="0" cellpadding="0">
<form method="POST" action="content.pl" ENCTYPE="multipart/form-data">
<br>
Content:<br>
<textarea name="content" rows="25" cols="60">$content</textarea>
<br>
<br>
<input type="submit" name="submit" value="Submit">
</form>
</td>
</tr>
</table>
EOF
Thanks!