Regexps in 5.11 [was Re: Perl Christmas Quiz]

Paul LeoNerd Evans leonerd at
Tue Dec 16 10:56:31 GMT 2008

On Fri, 12 Dec 2008 14:41:07 +0000
Nicholas Clark <nick at> wrote:

> regexps internally became a first class concept in 5.11

Oooh. I wonder, is that why my Devel::Refcount fails everywhere on 5.11,
with wobblies about the reference count of qr//?


I have a temporary hack on this currently:

   if( $] >= 5.011 ) {
      # Perl v5.11 seems to have odd behaviour with Regexp references. They start
      # off with a refcount of 2. Not sure if this is a bug in Perl, or my
      # assumption. Until P5P have worked it out, we'll skip this, but just print
      # a diagnostic
      diag( "On Perl $], refcount(\$refs{Regexp}) is ".refcount($refs{Regexp}) );
      skip "Bleadperl", 1;

   is( refcount($refs{Regexp}), 1, 'refcount(Regexp) is 1');

but I'd love to get to the bottom of it. Do you know any writings or
authoritative source on the changes?

Paul "LeoNerd" Evans

leonerd at
ICQ# 4135350       |  Registered Linux# 179460
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the mailing list