in reply to Re^2: Get regexp modifiers
in thread Get regexp modifiers

I think ref($check_re) ne 'Regexp' can fail in modern Perls.

Could you explain that? (Or post a link to the relevant documentation?)

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^4: Get regexp modifiers
by ikegami (Patriarch) on Jan 06, 2010 at 16:01 UTC
    ./perl -Ilib -le' my $r = ${ qr/abc/ }; print $r; print ref($r) ?1:0; print re::is_regexp($r) ?1:0; print "abc" =~ $r ?1:0; ' (?-xism:abc) 0 1 1

    "sufficiently modern" appears to mean ≥5.12 in this case

      "sufficiently modern" appears to mean ≥5.12 in this case

      Thanks. So it's a problem with the bleeding edge and not with stable and vintage versions, and I still have a lot of time until that problem may bite me.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
        5.12 is a stable version. It just doesn't exist yet. Testing was done with something newer than 5.11.3, but this is something that isn't going to change.