Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^2: Multi-line comments in perl code?

by TheDamian (Priest)
on Jul 14, 2006 at 13:33 UTC ( #561210=note: print w/replies, xml ) Need Help??

in reply to Re: Multi-line comments in perl code?
in thread Multi-line comments in perl code?

The last item may change with Perl6, for "=begin/end", but the rest will probably not.
Actually, the first point:
POD is the official way to do multi line comments in Perl
will also change in Perl 6, which introduces an indentable, nestable, multi-line-able delimited comment:
#{ comment here } #[ comment here ] #( comment here ) #< comment here > # comment etc.
A delimited comment is introduced by a # followed immediately by any kind of opening bracket. It is closed by the corresponding closing bracket.

Replies are listed 'Best First'.
Re^3: Multi-line comments in perl code?
by jdporter (Canon) on Jul 14, 2006 at 19:02 UTC

    Ow. Would it be too much to ask that it accept any sequence of openingbrackets — e.g.

    because I could easily see myself wanting to comment out blocks of code with unbalanced closing brackets of all four types (or, more to the point, a dynamic selection of closing bracket types). Having an unlimited variety of comment "identifiers" also facilitates arbitrarily nesting comments without artificial restrictions.

    We're building the house of the future together.
      Ow. Would it be too much to ask that it accept any sequence of opening brackets
      Not to much to ask at all. At least, not as long as you can be satisfied with multiple repetitions of the same delimiter character. From the latest update of Synopsis 2:
      • For all quoting constructs that use user-selected brackets, multiple, adjacent, identical opening brackets must always be matched by an equal number of adjacent closing brackets. Bracket counting naturally applies only to sets of brackets of the same length:
            say #{{
                Comment contains unmatched } and { { { { plus a counted {{ ... }} pair.
            }} q<< <<woot>> >>   # says "<<woot>>"
        Awww, that will break my Emacs folding-mode (folding.el), which assumes folding start # {{{ and folding end # }}}

            All Perl:   MT, NLP, NLU

      If I read it correctly, Damian said, "It is closed by the corresponding closing bracket." [Emphasis added]

      So, the compiler ignores the non-corresponding closing brackets.

Re^3: Multi-line comments in perl code?
by BrowserUk (Pope) on Jul 15, 2006 at 01:02 UTC


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://561210]
[Eily]: what? I thought PHP was known for its reliable and consistent behaviour and documentation!
[LanX]: ... and a lot of pseudo Perl experts
[Eily]: though honestly, I'm sure I have seen people use closure to mean anonysub for perl as well
[stonecolddevin]: good morning friends
[LanX]: yes, mainly pseudo Perl experts
[Eily]: good morning stonecolddevin
LanX has to go/
[Eily]: bye LanX
[LanX]: bye :)

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2018-02-23 17:15 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (305 votes). Check out past polls.