ybiC has asked for the wisdom of the Perl Monks concerning the following question:

I'm adding pod to a script, and got a good start by reading perlpod.   Contents of pod include { and }, with a new line immediately following the closing }.   Problem is, the closing } "joins" the next line, which ruins the example syntax.   I've tried =begin text and =end text with no success, also confirmed that all empty lines are completely empty.

How I need perldoc to format:

{ blah, blah } yadda, yadda

How perldoc actually formats:

{ blah, blah }yadda, yadda

Perl 5.006 on OpenBSD 2.7.
The blah, blah } yadda, yadda is *not* Perl, so the difference *does* matter.
    cheers,
    ybiC

Replies are listed 'Best First'.
Re: pod and special characters
by btrott (Parson) on Aug 12, 2000 at 21:48 UTC
    If you need to use precise formatting, I've always found that indenting the text that I'm formatting preserves the formatting that I use. In pod2html, for example, it wraps that stuff in a <pre> section, I think.

    I think you only need to indent it one space; I always like doing about four, but that's just me. So you might try:

    Regular POD paragraph... { blah, blah } yadda, yadda Another regular POD paragraph.
    Also remember that POD translators think in terms of "paragraphs", where one paragraph is separated from another by two carriage returns. If you only leave one carriage return between paragraphs, they'll get meshed into the same paragraph. Make sense?
      It doesn't make complete sense, btrott, but indenting one space at the right lines fixed the "join" problem.
          beaucoup de mercis,
          viel dank,
          molti ringraziamenti,
          muitos agradecimentos,
          muchas gracias,
          many thanks,
          ybiC
        You actually only needed to indent the first word.

        The reason why it works is explained in perlpod. If the paragraph starts with whitespace it is interpreted as a verbatim paragraph. Otherwise it is not.