Upgrade to Safe 2.30
authorRafael Garcia-Suarez <rgs@consttype.org>
Tue, 6 Dec 2011 21:02:21 +0000 (22:02 +0100)
committerRafael Garcia-Suarez <rgs@consttype.org>
Tue, 6 Dec 2011 21:03:11 +0000 (22:03 +0100)
[rt.cpan.org #72872] Fix bad interaction with loading
Tie::Hash::NamedCapture on perls >= 5.14.0

MANIFEST
dist/Safe/Changes
dist/Safe/MANIFEST
dist/Safe/META.yml
dist/Safe/Safe.pm
dist/Safe/t/safenamedcap.t [new file with mode: 0644]

index 7153dd4..c6eb168 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -3422,6 +3422,7 @@ dist/Safe/t/safe1.t               See if Safe works
 dist/Safe/t/safe2.t            See if Safe works
 dist/Safe/t/safe3.t            See if Safe works
 dist/Safe/t/safeload.t         Tests that some modules can be loaded by Safe
+dist/Safe/t/safenamedcap.t     Tests that Tie::Hash::NamedCapture can be loaded
 dist/Safe/t/safeops.t          Tests that all ops can be trapped by Safe
 dist/Safe/t/safesort.t         Tests Safe with sort
 dist/Safe/t/safeuniversal.t    Tests Safe with functions from universal.c
index 385287c..54f9dc6 100644 (file)
@@ -1,3 +1,7 @@
+2.30 Tue Dec  6 2011
+    - Fix bad interaction with loading Tie::Hash::NamedCapture
+      on perls >= 5.14.0 [rt.cpan.org #72872]
+
 2.29 Sun Oct 31 2010
     - Add &version::vxs::VCMP to Safe's default share
 
index a610ca7..b527bc4 100644 (file)
@@ -7,6 +7,7 @@ t/safe1.t
 t/safe2.t
 t/safe3.t
 t/safeload.t
+t/safenamedcap.t
 t/safeops.t
 t/safesort.t
 t/safeuniversal.t
index 58d10ed..14c4c5a 100644 (file)
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               Safe
-version:            2.29
+version:            2.30
 abstract:           ~
 author:  []
 license:            unknown
@@ -14,7 +14,7 @@ no_index:
     directory:
         - t
         - inc
-generated_by:       ExtUtils::MakeMaker version 6.55_02
+generated_by:       ExtUtils::MakeMaker version 6.57_05
 meta-spec:
     url:      http://module-build.sourceforge.net/META-spec-v1.4.html
     version:  1.4
index 70549c5..8d0e4fd 100644 (file)
@@ -4,7 +4,7 @@ use 5.003_11;
 use strict;
 use Scalar::Util qw(reftype refaddr);
 
-$Safe::VERSION = "2.29";
+$Safe::VERSION = "2.30";
 
 # *** Don't declare any lexicals above this point ***
 #
@@ -102,15 +102,6 @@ my $default_share = [qw[
     &re::regname
     &re::regnames
     &re::regnames_count
-    &Tie::Hash::NamedCapture::FETCH
-    &Tie::Hash::NamedCapture::STORE
-    &Tie::Hash::NamedCapture::DELETE
-    &Tie::Hash::NamedCapture::CLEAR
-    &Tie::Hash::NamedCapture::EXISTS
-    &Tie::Hash::NamedCapture::FIRSTKEY
-    &Tie::Hash::NamedCapture::NEXTKEY
-    &Tie::Hash::NamedCapture::SCALAR
-    &Tie::Hash::NamedCapture::flags
     &UNIVERSAL::DOES
     &version::()
     &version::new
@@ -137,6 +128,16 @@ my $default_share = [qw[
     &version::vxs::VCMP
 ]), ($] >= 5.011 && qw[
     &re::regexp_pattern
+]), ($] >= 5.010 && $] < 5.014 && qw[
+    &Tie::Hash::NamedCapture::FETCH
+    &Tie::Hash::NamedCapture::STORE
+    &Tie::Hash::NamedCapture::DELETE
+    &Tie::Hash::NamedCapture::CLEAR
+    &Tie::Hash::NamedCapture::EXISTS
+    &Tie::Hash::NamedCapture::FIRSTKEY
+    &Tie::Hash::NamedCapture::NEXTKEY
+    &Tie::Hash::NamedCapture::SCALAR
+    &Tie::Hash::NamedCapture::flags
 ])];
 
 sub new {
diff --git a/dist/Safe/t/safenamedcap.t b/dist/Safe/t/safenamedcap.t
new file mode 100644 (file)
index 0000000..6afa70e
--- /dev/null
@@ -0,0 +1,21 @@
+BEGIN {
+    if ($] < 5.010) {
+       print "1..0\n";
+       exit 0;
+    }
+    require Config;
+    import Config;
+    if ($Config{'extensions'} !~ /\bOpcode\b/) {
+       print "1..0\n";
+       exit 0;
+    }
+}
+
+use strict;
+use Test::More;
+use Safe;
+plan(tests => 1);
+
+BEGIN { Safe->new }
+"foo" =~ /(?<foo>fo*)/;
+is( $+{foo}, "foo", "Named capture works" );