in reply to Segmented text processing (with POD?)

Clarification:

I'm writing content for a website in mostly-plaintext files. The first paragraph is headers (think email), containing metadata. The rest is content. Right now, all of the content goes through HTML::FromText to turn it into nice pretty web-friendly markup. Unfortunately, it's difficult to do things like post Perl code sippets with this method, because they end up getting parsed like they're plain text by HTML::FromText. (Yes, there's a document-wide switch to text2html to treat indented paragraphs as code; 95% of the time, I don't want that.)

What I want is a nice way to say "this chunk of text is plaintext, and should be marked up by HTML::FromText; this chunk is Perl, and should be marked up by perltidy; this chunk is C, and should be marked up by <foo>", and so on. I want to do this in as transparent a manner as possible; if I wanted to write my content in some heavyweight markup language, I'd use HTML and skip the middleman.

I'm thinking that POD might be a useful way of doing this: I could use one of the many POD modules to chunk my input, and POD has a nice, minimal syntax.

Update: Looks like POD's the way to go. Thanks Aristotle and domm!

--
The hell with paco, vote for Erudil!
:wq

Replies are listed 'Best First'.
Re^2: Segmented text processing (with POD?)
by Aristotle (Chancellor) on Jul 14, 2002 at 21:40 UTC
    POD allows this with the for (or begin) directives; something like
    =for email Usenet style stuff here =end email =for perltidy some_code_here(); =end perltidy
    See perlpod. I haven't fiddled with the Pod::Parser or siblings to know how much effort it would be to actually implement this though.

    Makeshifts last the longest.