I have tried with HTML::Parser
I wonder why, since there is no HTML to parse. Instead see this solution using s///:
use strict; use warnings; use Test::More tests => 1; my $have = 'foo bar'; my $want = 'foo<br />bar'; $have =~ s/\n/<br \/>/; is $have, $want;
Hopefully you will see here that I have included nothing which is superfluous to the task at hand.
In reply to Re: Newbie - convert carriage return in a variable
by hippo
in thread [Solved]Newbie - convert carriage return in a variable
by Balawoo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |