Your argument rests on the premise that this is a bug and not a feature, a postion you come to by there not being a Regexp.pm module, and the lack of documentation of this behaviour.

Well, I think that may be oversimplifying my position a touch. I do admit that it would be a moot point if it were documented but I think I'd rather see it changed than documented. Well, to clarify, I think that there should be a Regexp module, it should be documented, and the behavior that these thingies retain magic through reblessing should be changed. I can see the usefulness of that behavior but I am not convinced that it outweighs the inconsistency it causes. More on that (but not much more) in a bit.

I regret not being able to discuss this over a beer.

Hear, hear! :-)

The type of dumper I have in mind is more for debugging/development purposes.

By all means then! A debugging tool absolutely should tell you what is really going on regardless of whether what is really going on is documented. You certainly have my... er... "blessing."

I dont agree with your analysis. The product of a qr//, blessed or not, is a search pattern. Theres nothing that says otherwise and much that indicates the contrary.

Here's the "more on that" that I promised... I think we mostly agree, actually. The product of qr// is a search pattern. I just find it disappointing that it is also a reference which acts differently than other references in a few (admittedly rare) cases. Because of this inconsistency we can't write a module with a constructor that takes any reference and still have the expectation that our stringification will act as a search pattern when the object is used on the right side of the binding operator.

I fully understand that this isn't a huge loss. Aesthetically, it irks me though. Oh well. One man may see a hairy mole where another sees a beauty mark, I guess. Realistically, it is probably of little consequence. I can't even say that I've been bitten by it, but I do imagine there are a few that have been in one way or another.

I've enjoyed this exchange as well, demerphq. Thanks for bringing it up.

-sauoq
"My two cents aren't worth a dime.";

In reply to Re: Re: Re: Re: Re: Re: Re: Code critique XS function for extracting a blessed regex's pattern. by sauoq
in thread Code critique XS function for extracting a blessed regex's pattern. by demerphq

Title:
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, 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:
    & &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.