I have a form that people enter large amounts of text in. I convert any line breaks to HTML line break tags before writing to the file. Most people end up hitting enter several times at the end of the field and I'm unable to strip all of those line breaks out, so I end up with four or five HTML line breaks at the end. I've tried this but it doesn't work.
$field =~ s/\\n\\n\\n/<br\>/;
How can I strip whatever whitespace and line breaks happen at the end of the text.
Also, a lot of people copy and paste directly from Word into the form (even though we ask them not to). I strip out what I can, but there's always some characters I haven't thought of. Is there a way to auto convert to text so it doesn't screw up my rss feeds?