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.
In reply to Re: Substituting Newline Characters
by Joost
in thread Substituting Newline Characters
by bkiahg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |