Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I know that in Java you can place a */ or something similar at the beginning and end of the comments, and then not have to start each new sentence with a star.

The first thing to realize is that you don't have to type a hash at the start of every line. (You used the word "star", but a star is this symbol: "*". A "hash" or a "pound sign" is this symbol: "#". Just so you know... :-) )

Any decent editor (and quite a few bad ones) will let you comment a block without really thinking about it. The trick is, finding an editor that you're used to. I don't really recommend learning vi (it's horrible to learn), but once you know it, things work almost without any concious effort.

For example, using vi, I do this, pretty much by reflex:

  1. type "ma" (mark current line as "a")
  2. hit "i" for insert mode, then type my comment
  3. hit "ESC" (to exit insert mode)
  4. type "mb" (to mark the new line (the end of the comment) as "b")
  5. type ":'a,'bs/^/#/" (from line a to line b, match at the start of line, and substitute in a hash )
  6. type ":'a,'b>" (optional: indent one level, add more > symbols to indent more)

You can do pretty much the same thing in Emacs, or any other editor you like.

Good luck! :-)

In reply to Re: Multi-line comments in perl code? by Anonymous Monk
in thread Multi-line comments in perl code? by mrguy123

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • 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, 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, 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (3)
    As of 2020-08-14 15:26 GMT
    Find Nodes?
      Voting Booth?
      Which rocket would you take to Mars?

      Results (76 votes). Check out past polls.