Maybe:
${text} =~ s#[\r\n]+#<br />#g;
On 28 Jun 2004 15:13:06 -0400, Charles Farinella wrote
> I have a textarea on a webpage that gets stored in a database. I'd like
> to convert the newline to an HTML <br> before it gets stored so when
> I display it, the line breaks as it was typed. I've been looking around
> but haven't found an example.
>
> $text =~ s/\r\n/<br>/g;
>
> doesn't work.
>
> --charlie
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>