Gossamer Forum
Quote Reply
tags
Hello,

Here's what I got:

Code:
open (DAT, "$datfile");
@output = <DAT>;
close DAT;
print "<form action=\"$ENV{'SCRIPT_NAME'}\" method=POST><TEXTAREA value=\"output\" ROWS=20 COLS=60 wrap=\"OFF\">@output</TEXTAREA></form>";

The problem is that the output inside the textarea (starting from the second line) will have a space character at front of each line. In my database I don't have any spaces at front of each line.
Could it be a <TEXTAREA> tag bug? - I don't know.
I need to get rid off these spaces, because the text from textarea will be saved back to the database. Anybody, please help!

Thank you.

Pasha
Quote Reply
Re: tags In reply to
What kind of space is that? Perhaps you would use this code to take off the "space".

DAT =~ s/&#38;nbsp;//s;

Or you might want to change that &#38;nbsp; to how the "space" character looks like. Correct me if Im wrong as I am not so good in Perl, yet! Smile
Quote Reply
Re: tags In reply to
Doesn't help. The spaces are still there.
Quote Reply
Re: tags In reply to
Here's the output I get in both cases:
Quote Reply
Re: tags In reply to
Try this:

$output =~ s/ //g;

OR

$output =~ s/ //g;

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: tags In reply to
Thank you guys, I solved the problem this way:

Code:
open (DAT, "$datfile");
@lines = <DAT>;
close DAT;
print "<form action=\"$ENV{'SCRIPT_NAME'}\" method=POST><TEXTAREA value=\"output\" ROWS=20 COLS=60 wrap=\"OFF\">";
foreach $line (@lines)
{
print "$line";
}
print "</TEXTAREA></form>";


Thank you.

Pasha
Quote Reply
Re: tags In reply to
Hmmm... pain. How do I print it back to the $datafile?

Thank you.

Pasha
Quote Reply
Re: tags In reply to
Ummm, you mean after the form has been posted back to the script?

Well, you'll need to parse the form, so do you already have a readparse subroutine? If you do, you'll need to add a NAME attribute to the TEXTAREA tag, and do something like this:

(This assumes that the array returned from your readparse routine is $in, and the name you gave the TEXTAREA was "data".)

open (>DAT, "$datfile");
print DAT $in{'data'};
close DAT;

Cheers,
adam

[This message has been edited by dahamsta (edited August 06, 1999).]
Quote Reply
Re: tags In reply to
dahamsta,

I use CGI module, so the code is a little bit different. Any way, I got it working Smile


Thank you!

Pasha

------------------
The Flying Cranes, Inc:
http://www.theflyingcranes.com
Perl scripts & Web promotion:
http://find.virtualave.net