I have a little Perl script that goes something like this:
#!/usr/bin/perl -w
$lkd = "line one\nline two\nline three";
$lkd =~ s/\n/<br>/g;
print "$lkd";
And it outputs something like this:
line one
<br>line two
<br>line tree
<br>
I thought s/\n/<br>/g; would swap all the newlines with html break? It seems to me that it does not replace the newlines? Or should I append another letter to the regex so that it can substitute newlines?
Thanks in advance for your help!
Best Regards,
Jollekox
#!/usr/bin/perl -w
$lkd = "line one\nline two\nline three";
$lkd =~ s/\n/<br>/g;
print "$lkd";
And it outputs something like this:
line one
<br>line two
<br>line tree
<br>
I thought s/\n/<br>/g; would swap all the newlines with html break? It seems to me that it does not replace the newlines? Or should I append another letter to the regex so that it can substitute newlines?
Thanks in advance for your help!
Best Regards,
Jollekox