Re: Multiline comment in Perl

[email protected] ("Octavian Rasnita")
Newsgroups perl.beginners
Message-ID <02ae01c8b9d7$c6b81880$c2a2b451@teddy>
From: "Rob Dixon" <[email protected]>
> Yes, I'm afraid I misquoted the entry from perlfaq7, which actually
> recommends
>
> =begin comment
>  :
> =end comment
>
> =cut
>
> which is clumsy, to say the least. However I use
>
> =begin comment
>  :
> =cut
>
> which works fine, and I don't think contravenes POD syntax except that
> =cut
> should strictly be preceded and followed by blank lines, but Perl doesn't
> seem
> to care. The comment block is closed implicitly by =cut.

Oh yes, but if the recommendation is not respected completely, I think it 
could be almost the same to use =start instead of the longer =begin comment. 
Even something shorter like =c could be used.

By the way, what do you think about the following commenting style:

q/
the
commented
lines
/;

It is a valid perl code, and it only gives a warning if "use warnings" is
used, but it is not a problem because we know that this scalar is used in
scalar context not because there is an error, but because we want this.

And it is much shorter than the POD syntax.

Octavian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.