I am trying to replace newline characters in the DB with <br/>
tags and have the following mySQL query string written in Perl.
my $queryString = "Select REPLACE(r.form_text,'\n','<br /> '), ... FROM myTable r;"
For some reason, \n
is treated as a newline from within perl and does not seem to replace it with <br/>
. Here is what I got when I tried to print $queryString
REPLACE(r.form_text,'
','< br /> ')
I tried to use \\n
and \\\n
and it didn't work either. I apologize if this is a repeated question. Please let me know if I'm missing something here.