in reply to comment sections

You could simply:
#!/usr/bin/perl -w use strict; # Every job should # Start of comments if (defined undef) { foo... } # End of comments &do_more_stuff();
In terms of efficency - using a constant should kill a large block like that at compile time as opposed to run time (although the optimiser might take away the code in the solution above?).
#!/usr/bin/perl -w use strict; use constant COMMENT_WRAPPER => 0; # Start comments if (COMMENT_WRAPPER) { Blah Blah } # End comments &carry_on_with_stuff();

game(Wookie,opponent) eq 'Wookie' ? undef $problem : remove_limbs(arms,opponent);

Replies are listed 'Best First'.
Re: comment sections
by Abigail-II (Bishop) on Apr 15, 2003 at 11:55 UTC
    But that requires that the stuff you outcomment is actually compilable. And it won't help to outcomment a BEGIN block.

    Abigail

      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"; }