Forum Moderators: coopster & phranque

Message Too Old, No Replies

Bulk Comments in Perl

         

incrediBILL

1:56 am on Jan 21, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is there any way to make bulk comments in Perl other than the cheesy workarounds I use?

Currently, the only 2 ways I know are:

=ignore
bunch of code...
=cut

or equally as repugnant, something like this:

$comment = qq|
bunch of code...
|;

Why in the heck didn't they use the very common convention from C, C++, PHP, etc. of /* and */ that everyone already knew and used?

Hard to believe they'd leave such a simple thing out of Perl

Am I just missing it?

Brett_Tabke

3:39 am on Jan 21, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I've always liked the fact that Perl DIDN'T have the /* commenting of C. (especially when you comment out blocks of code)

I used to be a comment junkie. Then came the web and it was all about load time and memory. You could really impact performance by cutting out all the comments in circa 96-99. So I got way out of the habit of commenting code much...

I do use
=comment
fun stuff here
=cut

I have it a a macro in my text editor (highlight the block - ctrl-q...done)

Interesting chart at the bottom of this perl monks thread:
[perlmonks.org...]