http://www.perlmonks.org?node_id=410494

awohld has asked for the wisdom of the Perl Monks concerning the following question:

I'm have a form field that I am submitting to a Perl CGI script, I want to replace all the new lines with <br> so when I redisplay the form submission in html that it formats the new lines correctly.
I have been trying each one of these because I'm not sure if it is a CR, LF, or CRLF:
$INPUT{'comments'} =~s/\n/<br>/g; $INPUT{'comments'} =~s/\r/<br>/g; $INPUT{'comments'} =~s/\r\n/<br>/g;
I can't seem to figure out why I can't insert any of these HTML tags into my string. How do I replace the new lines that are in the multiline text box with the HTML Break Tags?