[thelist] Formatting text fields

Matthew Fischer mfischer at e-fishsolutions.com
Mon Feb 5 09:45:37 CST 2001


Adrian --

Try this:

$form{'PARA2'}=~s/\r\n\cM\n/<P>/g;
$form{'PARA2'}=~s/\r\n/<BR>/g;

When submitted from a Mac or PC, the new line at the end of a line of text is actually a return followed by a newline (\r\n), and the blank line is actually a control-M followed by a newline (\cM\n).

The way this is written it will put the data from the whole field on one line, with the <p> and <br> tags included.

HTH

On 2/4/01 at 7:15 PM, adrian at logo-logic.com (Adrian Fischer) wrote:

> I have this snippet of perl stuff but I must have left out some stuff when I
> wrote it down because it dont do nut'n...
> I assume it should be looking for 2 new lines and replacing them with a <P>
> and with a <BR> for a single new line.
> But nothing happens
> 
> $form{'PARA2'}=~s/\n\n/<P>/g;
> $form{'PARA2'}=~s/\n/<BR>/g;
> It should take the text in PARA2 and format it but...nothing changes...can
> some good samaritan point me in the right direction


_____________________ >}}}}}@> ________________________________
matthew fischer                         toll-free: 877.web.fish
e-fish solutions, inc.                      voice: 203.272.2987
mfischer at e-fishsolutions.com                  fax: 800.203.5816
http://e-fishsolutions.com                   cell: 203.988.5663
__________________________________ <@{{{{{< ___________________




More information about the thelist mailing list