Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: comment sections

by rir (Vicar)
on Apr 16, 2003 at 02:40 UTC ( [id://250760]=note: print w/replies, xml ) Need Help??


in reply to Re: comment sections
in thread comment sections

I vote for using #s as I've stated elsewhere under the heading no pod & code.

Personally I find the desire or need to temporarily comment out fair sized blocks of code is a warning of impending danger or difficulty. And usually these style of comments are meant to be temporary. Often the trouble is so imminent that it has already arrived.

Requiring commented code to be compilable seems like a feature to me. But I know what you mean.

Quick update: The following is not what Abigail said. Abigail pointed out that you can't comment the entire BEGIN block this way. You can't. You can't comment out any other subroutine definition either. Or forward sub declaration.

And you can comment out code in a begin block. Viz:

#!/usr/bin/perl use strict; use warnings; BEGIN { use constant COMMENT => 0; } BEGIN { if ( COMMENT ){ print "silence\n"; } print "noise\n"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://250760]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2025-04-30 20:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.