multiline comments

Matts on 2004-09-22T15:06:25

Seen on IRC:

=for comment =end is fine for me
Except that doesn't do what you think it does. =for is a single line formatting marker in pod, so it only marks whatever comes on the same line as the =for as a "comment" (ok, so since it's POD, it also includes anything on following lines as long as there's no blank lines following).

So a common scenario might be:
=for comment

This is a multiline comment.

Ignore this section of stuff.

=end
However a POD processor sees that as one line of "comment" stuff, and two lines of ordinary POD documentation paragraphs. Yes - the POD processor turns your commented out section as documentation.

I'm sure this is not what people want or intend.

What's the fix? This is what =begin/=end is for!
=begin comment

This is a multiline comment

Ignore this

=end
Run both under a modern POD (pre)processor and you should be able to see the difference.