Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Multiline comments

by vroom (Pope)
on Jan 04, 2000 at 22:51 UTC ( #1695=perlquestion: print w/replies, xml ) Need Help??

vroom has asked for the wisdom of the Perl Monks concerning the following question:

I read once of a way to do multiline comments in Perl does anyone know how this is done?

Replies are listed 'Best First'.
Re: Multiline comments
by nate (Monk) on Jan 05, 2000 at 00:27 UTC
    If you want, you can put anything you like after __END__
    ;)
Re: Multiline comments
by bdimych (Monk) on Dec 14, 2007 at 15:43 UTC
    =whatever you want ... all this text is now comment all this text is now comment all this text is now comment ... =cut
  • "=" must be the first character of the line
  • The end of comments must be exactly "=cut"

    See "man perlpod" and "man perlpodspec" for details

Re: Multiline comments
by dimar (Curate) on Jun 05, 2004 at 19:02 UTC

    It's time for @#$! multiline comments in perl!

    Yeah yeah, I know ...

    • use 'here docs' (poor option)
    • use 'POD' (interferes with docs and no indenting)
    • use 'ACME::Comment' (requires module install rights)
    • use the 'q' operator (unsuitable for serious use)

    q`<!-- --------------------------- <region-function_docs> main: - name : DoFoo desc : do some foo usage: DoFoo($optional_greeting); </region-function_docs> --------------------------- -->`if(000); sub DoFoo{ my $optional_greeting = shift || 'Hello World'; print "$optional_greeting\n"; print "we are now doing foo\n"; print "\n"; }###end_sub

    So just write your code like that and problem (solved?).

    Update: this workaround option parses free of warnings and errors, but is unsuitable for serious use in perl.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2020-08-14 15:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (76 votes). Check out past polls.

    Notices?