CGI / Perl remove new line character when printing to file.
Posted on 2004-10-16
I have an HTML textarea box that I want to save the input from into a text file.
Instead of printing each 'Enter /return' on a new line I want it on the same line with <br> printed instead.
I am using this at the moment but it doesn't quite work how I'd like;
$input =~ s/\n/<br>/g;
Currently saves as:
But I want it like this:
If you get what I mean, is this possible?
Many Thanks, S-P.