Textarea element returns "carriage return/line feed" but I want j ust the "\n"

All,

I have written a small cgi script that allows my users to submit some text
to a db.
everything work well except that it seems to be doubling their return keys.
Each time
they modify their entry the lines get one return key further apart. I read
this in one
of the Oreilly books...

"Upon submission of the form, the browser collects all the lines of text,
each separated by "%0D%0A" (carriage return/line feed)"

how can I convert the "%0D%0A" to just the regular "\n" character?
I cannot use the CGI.pm module.

Thanks,
Brad


**********************************************************************
Notice:  The area code for the Wal-Mart Bentonville General 
Office in the US has changed from 501 to 479.  Please make
sure that you are dialing 479 when making calls to any 
General Office location.

**********************************************************************
This email and any files transmitted with it are confidential
and intended solely for the individual or entity to 
whom they are addressed.  If you have received this email
in error destroy it immediately.
**********************************************************************
             Wal-Mart Stores, Inc. Confidential
**********************************************************************

0
Brad
6/24/2002 10:23:08 PM
perl.beginners 29381 articles. 4 followers. Follow

1 Replies
638 Views

Similar Articles

[PageSpeed] 39

From: Brad Fike <Brad.Fike@wal-mart.com>

> I have written a small cgi script that allows my users to submit some
> text to a db. everything work well except that it seems to be doubling
> their return keys. Each time they modify their entry the lines get one
> return key further apart. I read this in one of the Oreilly books...
> 
> "Upon submission of the form, the browser collects all the lines of
> text, each separated by "%0D%0A" (carriage return/line feed)"
> 
> how can I convert the "%0D%0A" to just the regular "\n" character? I
> cannot use the CGI.pm module.

Assuming you have the data decoded :

	$data =~ tr/\x0D//d;

For parsing the query and decoding data you definitely SHOULD use 
CGI.pm. (Or maybe CGI::Deurl.pm? :-)

Jenda
=========== Jenda@Krynicky.cz == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
					--- me

0
Jenda
6/24/2002 10:30:49 PM
Reply: