in reply to Substituting Newline Characters
Why you'd want to is beyond me, though.
edit:
I see now. You need this $comments =~ s/\n/<br>\n/g;
Explanation: The g modifier specifies you want to substitute all matches instead of just the first one.
Ps: you can use <code> tags to type code with worrying about escaping < characters.
Edit2: I usually find it much easier on the users to do this instead: s/\n\n/<p>\n/g; and leave the single breaks alone.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Substituting Newline Characters
by BUU (Prior) on Mar 15, 2004 at 23:11 UTC | |
by Joost (Canon) on Mar 16, 2004 at 10:52 UTC |