Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by roux.tophe (Novice)
on Apr 25, 2014 at 15:11 UTC ( [id://1083798]=note: print w/replies, xml ) Need Help??


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

A "not-really-comment" that may be used also as a usage message...
my $comment= <<END_COMMENT this is how my script works and this is why it doesn't work blah blah END_COMMENT ; # don't forget the final ";"
... then usage function may print the $comment variable

Replies are listed 'Best First'.
Re: Answer: Better ways to make multi-line comments in Perl?
by choroba (Cardinal) on Apr 25, 2014 at 15:18 UTC
    You can put the semicolon after the here-doc indicator:
    my $comment = << 'END_COMMENT'; Comment END_COMMENT
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-03-29 12:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found