Generally speaking, there are no multiline comments in Perl. However, there are ways to cheat. And let me stress, that these are WRONG.

1. pod
POD is good. POD is sexy. But POD is for documentation, not comments. If you are evil, and don't care, you can use POD to add multiline comments. But don't do that.

# Code does stuff here my $foo = 7; =pod I set $foo to 7 here because 7 is the number of God. Don't believe me? Well, then, $you eq 'numbskull'. So anyway, this multiline "comment" really shouldn't be here. =cut # more code here

2. here documents
This is even worse. Use a here document and assign it to a variable or, even worse, to nothing!
Update: Note: Using the here document as I did will generate a warning. You do use the -w switch, right?

print "foo = $foo \n"; <<'END_COMMENT'; And then we print $foo. By the way, make sure you use single quotes for this here document otherwise your @variables will wind up being interpolated. Except you shouldn't use this in the first place, so the point is moot. END_COMMENT

Remember: don't do either of these things. Be content with one-line comments!

I feel so dirty...

print "All done! I'm a bad hacker! \n";

LAI

__END__

In reply to Re: multi line comments? by LAI
in thread multi line comments? by jcpunk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.