At 06:22 PM 2001-10-16 -0400, Mark-Jason Dominus wrote:
>What is the meaning of the following:
>
>--------------------------------BEGIN EXAMPLE
>
>print "1\n";
>
>=cut
>
>print "2\n";
>
>--------------------------------END OF EXAMPLE
[
 plus examples where one =cut starts a pod block and another ends it
]
>Sean, you might want to mention this in your spec.

That's a very good point, I never thought of that!  (That's in spite of the
fact that I now actually remember writing a file with exactly those kinds
of multiple "=cut"'s, to see what it'd do.)

[goes off and makes risotto.  ladle, stir, wait... ladle, stir, wait...]

OK, the risotto vapor has made me see three ways to do this:

1) a =cut can start a pod block, and it takes another one later to end it.

2) a =cut can start a pod block, but it simultaneously ends it.

3) It's an error to start a pod block with a =cut.  Why?  Because "=cut"
means "end the pod block that's open".
Any pod parser MUST consider it a horrible error to start a pod block with
a =cut, and MUST scream like a banshee about it, and should abort the parse
of the document.
(Maybe perl doesn't have to enforce this, altho it'd be nice if it did.
Patches, anyone?)

If you, the person writing pod, /are/ starting a pod block with a =cut,
you're probably doing it accidentally, in which case you would probably be
greatly aided by the error message.  And anyone who is /deliberately/ using
=cut to start pod blocks, deserves TORTURE.  And NO RISOTTO!


I think 3 is the way to go, and I'm thinking of writing it into perlpodspec
real soon now.

--
Sean M. Burke  [EMAIL PROTECTED]  http://www.spinn.net/~sburke/

Reply via email to