Day: August 20, 2009

nl2br in perl

How to replace new line character with br

$tempString = “Hello is testing for new line\n to br”;

$tempString =~ s/\n/<br\/>/;

output = “Hello is testing for new line
to br”;