htmanning has asked for the wisdom of the Perl Monks concerning the following question:
Monks,
I have a mail form. When it is submitted the $message field contains carriage returns that make it into the database as carriage returns, but when the email gets sent the message field is run together. I'm reading it in with:
Then doing one of these. I've tried them all:$message=$in{'message'};
None of them work. The source of the email shows white space between paragraphs, but because it's an HTML email the lines are run together when the user reads it. I need to convert those spaces to <br>. What am I missing?$message =~ s/\n/\<br\>/g; $message =~ s/\n/<br>/g; $message =~ s/\n/<br\>/g;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Converting carriage returns to HTML breaks
by tinita (Parson) on Apr 16, 2012 at 00:59 UTC | |
Re: Converting carriage returns to HTML breaks
by chromatic (Archbishop) on Apr 16, 2012 at 00:38 UTC | |
by htmanning (Pilgrim) on Apr 16, 2012 at 00:51 UTC | |
by Anonymous Monk on Apr 16, 2012 at 01:58 UTC | |
by fullermd (Priest) on Apr 17, 2012 at 00:46 UTC | |
Re: Converting carriage returns to HTML breaks
by thomas895 (Deacon) on Apr 16, 2012 at 03:48 UTC | |
Re: Converting carriage returns to HTML breaks
by Anonymous Monk on Apr 16, 2012 at 03:23 UTC | |
by AnomalousMonk (Bishop) on Apr 16, 2012 at 15:27 UTC | |
Re: Converting carriage returns to HTML breaks
by mendeepak (Scribe) on Apr 16, 2012 at 04:48 UTC |
Back to
Seekers of Perl Wisdom