On Thu, 27 Jul 2000, Barrie Slaymaker wrote:

BS>Below is the message that inspired this.
BS>
BS>How about adding an C<=also> POD tag?  It would have three syntaxes:
BS>
BS>=also for ...
BS>
BS>=also begin
BS>
BS>=also end
BS>
BS>These would be much like the existing three tags but "normal" POD
BS>converters would completely ignore them.  Then we could have:

I don't understand the benefit of =also in this context. Could you please
elaborate some more on this?

Thinking of "=for example":
Sounds nice to me, but keep these issues in mind:

* A "=for" tag takes exactly *one* paragraph, i.e. you *must* write the
  example this way, without any blank lines in between

=for example
print "Addition example\n";
print 2+2,"\n"

  Alternatively, one would have to use =begin example ... =end

* Pod::Parser currently leaves processing of =for and =begin ... =end
completely up to the calling code. Basically I like this, but introducing
special pre-defined =for directives might make it necessary to extend 
Pod::Parser. Then however you would give up control over the POD,
e.g. when a "=for example" paragraph is automatically turned into a
verbatim one. How would a "Pod::Example" then extract such example
paragraphs using Pod::Parser?

Therefore I'd suggest to keep Pod::Parser as is and to add code to
e.g. Pod::ParseUtils to deal with predefined paragraphs. Still this
requires to change the existing formatters in order to display such code.

Another issue: Should all "example" paragraphs from one POD be accumulated
into one script or do we need the possibility to have several different
example code snippets?

Just some thoughts...

-Marek

Reply via email to