Emacs also has a "ESC x comment-region" command (which I have bound to a key, myself). Select the block of
multi-line text, do a comment-region, and in cperl-mode, "# " will magically
appear in front of every line. If you do a "C-u" prefix first, you can use the same command to remove the commenting.
Alternately, it's not at all difficult to write keystroke
macros that do things like "insert a '#' in front of this
line and then move down one line", which you can loop to
comment a series of lines.
The default keystrokes for that (Off the top of my head,
and untested):
Defining the macro:
C-x (
C-a
#
C-n
C-x )
Running it once:
C-x e
Running it 10 times:
C-u 10 C-x e
My personal preference: don't use one of the workarounds.
Everyone understands "#" commented lines, but many will find your workaround confusing. Optimize for readability, not for ease of typing.
But if you do use a workaround, my preference would be for
abusing pod ('=for comment/=cut'), which is endorsed by Damien Conway in "Perl Best Practices".
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.