Is there any way to actually escape newlines such that perlpod does not generate space characters instead? I've tried playing around with the usual methods, but so far couldn't find any.
And then, there was a bit of epiphany.

One possibility that I did overlook is using Z<> to escape newlines. That's actually bending the rules, since perlpodspec states (emphasis mine):

This code is unusual in that it should have no content. That is, a processor may complain if it sees Z<potatoes>. Whether or not it complains, the potatoes text should ignored [sic].
And indeed, it does complain. At least podchecker and pod2man do. pod2html, on the other hand, does not. But even though the first two mention syntax errors, the document still seems to be parsed and rendered correctly.

Applying this to my first example:

Refer to the L<foobar section in the Module::Really::Really::Really::Very::Very::Long documentation|Z< >Module::Really::Really::Really::Very::Very::Long/foobar>.

Applying it to the second example is a bit more difficult:

This is a sentence. It's ending here, but the paragraph continues. Z< >This is another sentence.
Without the added space right before the starting part of Z<, continues. and This would be concatenated together directly.

Just to be clear: I consider this to be a crappy workaround rather than a real solution. A "real" solution would be adding whitespace escape capabilities to perlpodspec and the numerous POD parsers, which I should probably at least kick off via a bug report.


In reply to Re: Escape newlines in POD / (Selectively) don't generate space characters instead by Ionic
in thread Escape newlines in POD / (Selectively) don't generate space characters instead by Ionic

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.