How can I comment out a large block of perl code?

You can use embedded POD to discard it. The =for directive lasts until the next paragraph (two consecutive newlines).

    # program is here
    =for nobody
    This paragraph is commented out
    # program continues
The =begin and =end directives can contain multiple paragraphs.

    =begin comment text
    all of this stuff
    here will be ignored
    by everyone
    =end comment text
The pod directives cannot go just anywhere. You must put a pod directive where the parser is expecting a new statement, not just in the middle of an expression or some other arbitrary s grammar production.

See perlpod for more details.


Back to perlfaq7