in reply to Re: ref() and Regexp (blessed)
in thread ref() and Regexp

qr// returns a reference blessed into the "Regexp" package (so, no, the documentation for ref is not broken).

Aah, ok, so the perl 5.10 pod saying "The result Regexp indicates that the argument is a regular expression resulting from qr//"(emphasis mine), really means the same thing in less detail and nothing has changed between 5.8 and 5.10 in this regard? (I'm assuming this since grinder mentions that an actual change has been made in 5.11)

if you make an object based on a blessed qr// ref, then everthing continues to work but there is no good way to see that the ref is a compiled regex

Gotcha, I won't worry about this for now (I'm trying to build something with minimal dependencies), but thank you for the pointer to Data::Dump::Streamer->regex(), that looks really useful.


All dogma is stupid.

Replies are listed 'Best First'.
Re^3: ref() and Regexp (blessed)
by tye (Sage) on Jan 31, 2008 at 16:59 UTC

    You can also make an optional dependency on Data::Dump::Streamer rather easily. Using MakeMaker, you'd only document that the user installing Data::Dump::Streamer would allow blessed regexes to be used. Using Module::Build, I think the optional dependency could be declared such that the plethora of automated installation tools can decide to ask the user if they want to install it.

    I don't know what did or didn't change in 5.010, but I'd jump to the same conclusion as you for the same reasons.

    - tye        

      In 5.10, DDS isn't needed: re::is_regexp and re::regexp_pattern are available in core. (The latter requires use'ing re; the former doesn't.)