There are some other ways to "turn off" sections of code other than using the pod directives. For quickie debugging, I often use a simple: if(0){...} with the expectation that I will remove that once I find the program error. I guess a habit from writing other languages.

For something that I expect to "live" as part of the code, I sometimes do this:

use constant DEBUG => 0; if (DEBUG){ # block is optimized away at compile time .... # but I can turn in "on" again easily } # very readable and effective
I felt pairs of "=cut" is easier to remember than "=pod" or "=begin/end comment"
There is really only one thing to remember, "=cut", ends that section. You don't have to use =pod to start, use anything that you want. I think you have a confusing mess if you use =cut to start a pod block although that does work, despite the documentation to the contrary. For debugging, I guess anything goes, but I believe it unwise to go against the documentation because a someday Perl might actually wind up doing what the documentation says!

Your question is more of "how do I disable code" rather than permanent multi-line textual comments which I think is a different subject.


In reply to Re: Is it safe/recommended to use pairs of =cut for multi line comments? by Marshall
in thread Is it safe/recommended to use pairs of =cut for multi line comments? by Perl300

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.