http://www.perlmonks.org?node_id=17545

Ovid has asked for the wisdom of the Perl Monks concerning the following question:

Yet another humble begging of answers from wiser monks:

I have a form with textareas on it where I am setting the wrap to physical.

The form is submitted using a Perl CGI script which saves the data to a MYSQL database. Checking the database contents reveals that I am saving the data with carriage returns and line feeds. However, when I print the data back out to a Web page, the line feeds are stripped. Thus, the users cannot format their text into paragraphs.

Using PRE tags allows the line feeds to show up, but then the each line scrolls off the right edge of the screen. I've tried setting the table width to 100% and also tried setting it to 800 pixels, both to no avail. How do I get around this?

I am thinking that a perl substitution like this would work:

s/stuff to substitute/<P>\\n/g;
The problem is, I don't know what belongs in "stuff to substitute."