Re: [OT] Re: nesting coments

From: Dan Pop (Dan.Pop_at_cern.ch)
Date: 04/14/04


Date: 14 Apr 2004 17:39:33 GMT

In <g8kq70tgl2puo4mre2ddnbigumvgsmkp8i@4ax.com> Leor Zolman <leor@bdsoft.com> writes:

>On 14 Apr 2004 13:22:38 GMT, Dan.Pop@cern.ch (Dan Pop) wrote:
>
>>In <8rlo70hu5r268m2v61um4m0evjdbv8fdrt@4ax.com> Leor Zolman <leor@bdsoft.com> writes:
>>
>>>On Tue, 13 Apr 2004 20:53:30 GMT, Keith Thompson <kst-u@mib.org> wrote:
>>>
>>>>Personally, I like comments that extend from a delimiter to the end of
>>>>a line, and cannot cross line boundaries (like Ada's "--", C99/C++'s
>>>>"//", and Perl's "#"). In any decent text editor (both emacs and vi
>>>>qualify), it's easy to comment out or uncomment a range of lines, and
>>>>the comment marker is clearly visible on each line.
>>>
>>>I've done a lot of Perl hacking over the past three years, and I've sorely
>>>missed C-style comments. I just now did a Google search and discovered
>>>something that looks like:
>>>
>>>=pod
>>>
>>>blah blah
>>>
>>>=cut
>>>
>>> which I guess comes close to /* ... */. I guess I should have done that
>>>Googling three years ago ;-)
>>
>>That's not a particularly bright idea, either. Some day, you may want to
>>use this Perl feature for its intended purpose (keeping Perl code and its
>>documentation together) and having PODs containing "garbage" will bite
>>you.
>
>Anything that would have helped me (during the countless hours of
>debugging I've been doing with Perl scripts) to comment out large sections
>of code easily would have indeed been a "particularly bright idea" (or at
>least a useful one), and saved me much misery.

And you couldn't figure out that Perl's goto was *exactly* what you
needed?

    goto end_comment1;

    perl code commented out

    end_comment1:

By using a consistent naming convention for the label names (as suggested
above) you could immediately tell the difference between a "good" goto
(if you used any in your code) and the ones used for commenting out
large blocks of Perl code.

Dan

-- 
Dan Pop
DESY Zeuthen, RZ group
Email: Dan.Pop@ifh.de


Relevant Pages

  • Re: Good Golly Miss Molly Perl. Been so long.
    ... DF> use a goto. ... I can't give an example of Perl code where goto is the best solution, ... The canonical place I've seen goto used in C is to jump to cleanup code ... requires a lot of setup and teardown. ...
    (comp.lang.perl.misc)
  • Re: Could I put commands in a variable
    ... >> routine using a special form of goto() that erases the ... Note that I have never used goto in any perl code, ...
    (perl.beginners)
  • Re: [OT] Re: nesting coments
    ... my Perl code is ressembling to my C code. ... If the interpreter complains about syntax errors, ... Dan Pop ...
    (comp.lang.c)