Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Answer: Better ways to make multi-line comments in Perl?

by Anonymous Monk
on Aug 23, 2015 at 10:14 UTC ( [id://1139570]=note: print w/replies, xml ) Need Help??


in reply to Re: Better ways to make multi-line comments in Perl?
in thread Better ways to make multi-line comments in Perl?

Adding a multiblock coment: =for comment ....

:) You meant "=begin comment ... =end comment", see perlpodspec

  • Comment on Re: Answer: Better ways to make multi-line comments in Perl?

Replies are listed 'Best First'.
Re^2: Answer: Better ways to make multi-line comments in Perl?
by ww (Archbishop) on Aug 23, 2015 at 11:14 UTC

    Actually, either works. Didn't test correctly; used =begin comment ... =cut (which works) rather than =begin comment ... =end comment as AM proposed in Re: Answer: Better ways to make multi-line comments in Perl?. Fingers in gear; brain lagging behind.

    I found the =begin/=end format in http://perldoc.perl.org/perlpodspec.html#Pod-Commands\perlpodspec for 5.22 only under the heading "About Data Paragraphs and "=begin/=end" Regions" but ""=begin comment ... =end comment" does not work in AS 5.18.

    Granted, I'm mixing apples and ostrich eggs, above, but perlpod for 5.22 also appears (unless I'm misreading it) to suggest that =begin formatname/=end formatname and =for formatname... styles are for specialized cases only (see formatname, and not for run-of-the-mill comments.

      I see what you mean, =end doesn't signal to perl "pod over, perl code starts again", =cut does that, so it would have to be =begin comment ... =end comment\n=cut

      Using  =for multiblock comment has the unwanted side-effect of showing up if you use perldoc/pod2html...

      =pod/=cut has the same side-effect but that version is labeled quick/dirty

      If the intention is for #comments that aren't part of the documentation, =for comment multiline doesn't quite work for that purpose

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1139570]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-04-19 10:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found