in reply to comment sections

s there a way to have perl ignore a big section without having to put comments in front of every row?
Stricly speaking, no, as # is the only of creating comments (natively) in perl. However you can use POD to comment out large sections like so
use strict; =pod ... =cut exit 0;
However that won't work if you've got POD in the code inbetween. Another option is to use heredocs
use strict; <<'IGNORETHIS'; ... IGNORETHIS exit 0;
And finally there's always a CPAN module to do the job - Acme::Comment.
HTH

_________
broquaint

Replies are listed 'Best First'.
Re: comment sections
by Abigail-II (Bishop) on Apr 15, 2003 at 09:28 UTC
    If you are going to use the here doc way, I suggest putting single quotes around the delimiter; otherwise, Perl will interpolate anything starting with a $ or a @, which might cause warnings, or even compile errors if you use strict.

    Abigail

Re: Re: comment sections
by demerphq (Chancellor) on Apr 15, 2003 at 10:12 UTC

    However you can use POD to comment out large sections like so ....

    If I'm going to use pod for this (my editor handles it nicely so I don't usually) I prefer to use

    =begin block_comment ... =end block_comment =cut

    or for smaller chunks of code without blank lines in them a simple

    =for consideration_later ..... =cut

    Doing it this way has the advantage that the pod'ed out code doesnt get treated by the various pod parsers as being part of the actual documentation.


    ---
    demerphq

    <Elian> And I do take a kind of perverse pleasure in having an OO assembly language...