Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • > Old New
    > --- ---
    :
    >/patpat(?#text)/ /pat pat /

    Would there be something wrong with instead allowing

                              either /pat pat /
                                      or /pat pat /
                                      or /
    • As Larry says in the 'poco', /x is the default, meaning you can have inline comments like this:

          / x is the default # so this is a comment
              and this is not a comment /

      At least that's what I remember from yesterday. I wish perl.com was up so I could confirm that ;)
      • perl.com is back up (at least for me)

        apo5 explicitly (in text, and by examples such as the one quoted in my post above) says that to get an inline (meaning, I don't want to break my regex into two lines) comment you should assert a string.

        So, inline comments don't currently have a syntax, and instead, there is explicit advice to assert a string. I'm wondering whether we can either come up with an appropriate syntax, or not explicitly advise folks to use a kludge.

        It just feels like there's something amiss
        • Well, I checked again and you're wrong.

          Go to page 6 [perl.com] and look at the table at the bottom.

          The very first example shows an inline comment.
          • > Well, I checked again and you're wrong.

            Given that he defined "inline comment" to mean "I don't want to break my regex into two lines", he's very much correct. And since that's how Larry refers to inline comments, I'm inclined to agree with him on that definition.

            In fact, I'll agree with him across the line: A5 is good, I couldn't do better, this is a nit pick, telling people to use a string assertion as an inline comment is a time-bomb.

            Personally I don't much care if we have inline comments (even
            • Oops, I didn't read wickline's message carefully enough. I missed the part about not wanting to break the regex into two lines.

              Geez, what a weird nitpick though. I agree that telling people to use inline strings is potentially a problem, but why would you insist on single-line regexes?

              Do you try to keep all of you other code on one line too? ;)

              • > why would you insist on single-line regexes

                Personally, I have zero attachment to in-line comments
                in regexen. If your regex is short enough to fit on
                one line with an inline comment, then it can darn well
                fit on one line with a comment at the end of the line.

                So, if there is no support for them, I don't mind.

                However, perl5 supports them, and rather than saying
                that they go away in perl6, the apo currently documents
                (and recomends?) the practice of asserting a string.

                *That* is my real nit pick. I think t