John M. Dlugosz said
I think you are asking for trouble, unless you come up with a more comprehensive approach.

If nobody has such a thing already, I suppose you will be designing it. I look forward to that thread!

I can't be much less comprehensive than I have been up to now. This seems as good a place as any to start the thread. Yes, I expect to use a preprocessor (of my own, nothing to do with C's) to extract the pod. Suppose we assume input of the form
#ifdef pod (plain old pod here) #endif /* pod */
or
/* pod first line of pod (plain old pod here) pod */
The latter has the advantage over #ifdef of allowing the first line of pod to share the line with the "pod opener", but I'm less pleased with the way it terminates the block. I'd like to hear opinions. In either case, we can easily identify the start and end of the pod. Suppose we take everything in between and eliminate all leading white space. This leaves something the pod processors will like. This leaves the problem of preserving leading white space when a verbatim paragraph is desired. We could accommodate that by adding a bit of "faux pod" (a term I should copyright) like
=v leave =v this stuff =v alone
where we could preprocess out the =v (and a single space, so we don't run afoul of some real pod directive?), and leave everything that follows untouched. No need for a final =cut, we could supply it automatically when we hit the pod terminator, or just omit it altogether, since the preprocessor is only gathering pod, so there's no need to drop "in and out".

Thread begun. Comments?


In reply to Re^4: Embedding pod in C by jpl
in thread Embedding pod in C by jpl

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.