Are you perhaps on a Windows machine? If so, you have
dealt with the
\n in each
end-of-line
\r\n pair, but you have
left the
\r behind.
So the lines are over-laying
each other. I submit that
what you actually have as the result of
your
SELECT query
is (ignore the fact that I am showing this on separate
lines; you have gotten rid of the \n's but it helps
to show how things line up.):
Hello,\r
<p>\r
<p>This is a test.\r
<p>\r
<p>Bye Bye.
At the end of each line, the
\r,
is just moving the
cursor back to the beginning of the line and
writing the next line right over the top of
the previous one. Smash each of those lines right over
the top of the previous line and by the time you get to
the end, you have:
<p>Bye Bye.a test.
Once you see that, you are probably clear that your
regex should be:
$info =~ s/\r\n/<p>/g;
Hope that helps. (Actually, you probably didn't need
anything past the heads-up in the first line or two
of this post.) And if you are
not on Windows,
then I don't have a clue!
;-) MSgremlins,
perhaps...
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.