Attaching patch. The directory was not easy to find.
diff -ur YAML-0.72-zWbVhp~/lib/YAML/Types.pm YAML-0.72-zWbVhp/lib/YAML/Types.pm
--- YAML-0.72-zWbVhp~/lib/YAML/Types.pm 2010-09-01 04:03:12.000000000 +0200
+++ YAML-0.72-zWbVhp/lib/YAML/Types.pm 2010-11-07 09:45:33.000000000 +0100
@@ -219,9 +219,10 @@
sub yaml_load {
my $self = shift;
my ($node, $class) = @_;
- return qr{$node} unless $node =~ /^\(\?([\-xism]*):(.*)\)\z/s;
+ return qr{$node} unless $node =~ /^\(\?([\^\-xism]*):(.*)\)\z/s;
my ($flags, $re) = ($1, $2);
$flags =~ s/-.*//;
+ $flags =~ s/^\^//;
my $sub = _QR_TYPES->{$flags} || sub { qr{$_[0]} };
my $qr = &$sub($re);
bless $qr, $class if length $class;
diff -ur YAML-0.72-zWbVhp~/MANIFEST YAML-0.72-zWbVhp/MANIFEST
--- YAML-0.72-zWbVhp~/MANIFEST 2010-09-01 04:04:13.000000000 +0200
+++ YAML-0.72-zWbVhp/MANIFEST 2010-11-07 11:24:40.000000000 +0100
@@ -74,3 +74,7 @@
xt/meta.t
xt/pmv.t
xt/pod.t
+t/dump-perl-types-512.t
+t/dump-perl-types-514.t
+t/dump-tests-512.t
+t/dump-tests-514.t
diff -ur YAML-0.72-zWbVhp~/t/dump-perl-types-512.t YAML-0.72-zWbVhp/t/dump-perl-types-512.t
--- YAML-0.72-zWbVhp~/t/dump-perl-types-512.t 2010-11-07 11:28:37.000000000 +0100
+++ YAML-0.72-zWbVhp/t/dump-perl-types-512.t 2010-11-07 11:11:14.000000000 +0100
@@ -0,0 +1,26 @@
+use Test::More;
+BEGIN {
+ if ( qr/x/ =~ /\(\?\^/ ){
+ plan skip_all => "test only for perls before v5.13.5-11-gfb85c04";
+ }
+}
+use t::TestYAML tests => 2;
+
+filters { perl => ['eval', 'yaml_dump'] };
+
+no_diff;
+run_is ( perl => 'yaml' );
+
+__DATA__
+=== Regular Expression
++++ perl: qr{perfect match};
++++ yaml
+--- !!perl/regexp (?-xism:perfect match)
+
+=== Regular Expression with newline
++++ perl
+qr{perfect
+match}x;
++++ yaml
+--- !!perl/regexp "(?x-ism:perfect\nmatch)"
+
diff -ur YAML-0.72-zWbVhp~/t/dump-perl-types-514.t YAML-0.72-zWbVhp/t/dump-perl-types-514.t
--- YAML-0.72-zWbVhp~/t/dump-perl-types-514.t 2010-11-07 11:28:37.000000000 +0100
+++ YAML-0.72-zWbVhp/t/dump-perl-types-514.t 2010-11-07 11:16:32.000000000 +0100
@@ -0,0 +1,26 @@
+use Test::More;
+BEGIN {
+ unless ( qr/x/ =~ /\(\?\^/ ){
+ plan skip_all => "test only for perls v5.13.5-11-gfb85c04 or later";
+ }
+}
+use t::TestYAML tests => 2;
+
+filters { perl => ['eval', 'yaml_dump'] };
+
+no_diff;
+run_is ( perl => 'yaml' );
+
+__DATA__
+=== Regular Expression
++++ perl: qr{perfect match};
++++ yaml
+--- !!perl/regexp (?^:perfect match)
+
+=== Regular Expression with newline
++++ perl
+qr{perfect
+match}x;
++++ yaml
+--- !!perl/regexp "(?^x:perfect\nmatch)"
+
diff -ur YAML-0.72-zWbVhp~/t/dump-perl-types.t YAML-0.72-zWbVhp/t/dump-perl-types.t
--- YAML-0.72-zWbVhp~/t/dump-perl-types.t 2010-09-01 04:03:12.000000000 +0200
+++ YAML-0.72-zWbVhp/t/dump-perl-types.t 2010-11-07 09:49:58.000000000 +0100
@@ -1,4 +1,4 @@
-use t::TestYAML tests => 16;
+use t::TestYAML tests => 14;
filters { perl => ['eval', 'yaml_dump'] };
@@ -46,18 +46,6 @@
--- !!perl/ref
=: Goodbye
-=== Regular Expression
-+++ perl: qr{perfect match};
-+++ yaml
---- !!perl/regexp (?-xism:perfect match)
-
-=== Regular Expression with newline
-+++ perl
-qr{perfect
-match}x;
-+++ yaml
---- !!perl/regexp "(?x-ism:perfect\nmatch)"
-
=== Scalar Glob
+++ perl
$::var = 'Hola';
diff -ur YAML-0.72-zWbVhp~/t/dump-tests-512.t YAML-0.72-zWbVhp/t/dump-tests-512.t
--- YAML-0.72-zWbVhp~/t/dump-tests-512.t 2010-11-07 11:28:37.000000000 +0100
+++ YAML-0.72-zWbVhp/t/dump-tests-512.t 2010-11-07 11:11:51.000000000 +0100
@@ -0,0 +1,22 @@
+use Test::More;
+BEGIN {
+ if ( qr/x/ =~ /\(\?\^/ ){
+ plan skip_all => "test only for perls before v5.13.5-11-gfb85c04";
+ }
+}
+use t::TestYAML tests => 1;
+
+no_diff();
+run_roundtrip_nyn('dumper');
+
+__DATA__
+===
++++ no_round_trip
+Since we don't use eval for regexp reconstitution any more (for safety
+sake) this test doesn't roundtrip even though the values are equivalent.
++++ perl
+[qr{bozo$}i]
++++ yaml
+---
+- !!perl/regexp (?i-xsm:bozo$)
+
diff -ur YAML-0.72-zWbVhp~/t/dump-tests-514.t YAML-0.72-zWbVhp/t/dump-tests-514.t
--- YAML-0.72-zWbVhp~/t/dump-tests-514.t 2010-11-07 11:28:37.000000000 +0100
+++ YAML-0.72-zWbVhp/t/dump-tests-514.t 2010-11-07 11:18:06.000000000 +0100
@@ -0,0 +1,22 @@
+use Test::More;
+BEGIN {
+ unless ( qr/x/ =~ /\(\?\^/ ){
+ plan skip_all => "test only for perls v5.13.5-11-gfb85c04 or later";
+ }
+}
+use t::TestYAML tests => 1;
+
+no_diff();
+run_roundtrip_nyn('dumper');
+
+__DATA__
+===
++++ no_round_trip
+Since we don't use eval for regexp reconstitution any more (for safety
+sake) this test doesn't roundtrip even though the values are equivalent.
++++ perl
+[qr{bozo$}i]
++++ yaml
+---
+- !!perl/regexp (?^i:bozo$)
+
diff -ur YAML-0.72-zWbVhp~/t/dump-tests.t YAML-0.72-zWbVhp/t/dump-tests.t
--- YAML-0.72-zWbVhp~/t/dump-tests.t 2010-09-01 04:03:12.000000000 +0200
+++ YAML-0.72-zWbVhp/t/dump-tests.t 2010-11-07 09:50:16.000000000 +0100
@@ -1,4 +1,4 @@
-use t::TestYAML tests => 58;
+use t::TestYAML tests => 57;
no_diff();
run_roundtrip_nyn('dumper');
@@ -304,16 +304,6 @@
foo: 42
===
-+++ no_round_trip
-Since we don't use eval for regexp reconstitution any more (for safety
-sake) this test doesn't roundtrip even though the values are equivalent.
-+++ perl
-[qr{bozo$}i]
-+++ yaml
----
-- !!perl/regexp (?i-xsm:bozo$)
-
-===
+++ perl
[undef, undef]
+++ yaml
diff -ur YAML-0.72-zWbVhp~/t/regexp.t YAML-0.72-zWbVhp/t/regexp.t
--- YAML-0.72-zWbVhp~/t/regexp.t 2010-09-01 04:03:12.000000000 +0200
+++ YAML-0.72-zWbVhp/t/regexp.t 2010-11-07 09:49:26.000000000 +0100
@@ -2,16 +2,22 @@
use YAML();
no warnings 'once';
+my $m_xis = "m-xis";
+my $_xism = "-xism";
+if (qr/x/ =~ /\(\?\^/){
+ $m_xis = "^m";
+ $_xism = "^";
+}
my @blocks = blocks;
my $block = $blocks[0];
$YAML::UseCode = 1;
my $hash = YAML::Load($block->yaml);
-is $hash->{key}, '(?m-xis:foo$)', 'Regexps load';
-is YAML::Dump(eval $block->perl), <<'...', 'Regexps dump';
+is $hash->{key}, "(?$m_xis:foo\$)", 'Regexps load';
+is YAML::Dump(eval $block->perl), <<"...", 'Regexps dump';
---
-key: !!perl/regexp (?m-xis:foo$)
+key: !!perl/regexp (?$m_xis:foo\$)
...
my $re = $hash->{key};
@@ -25,13 +31,13 @@
$block = $blocks[1];
$hash = YAML::Load($block->yaml);
-is $hash->{key}, '(?m-xis:foo$)', 'Regexps load';
+is $hash->{key}, "(?$m_xis:foo\$)", 'Regexps load';
# XXX Dumper can't detect a blessed regexp
-# is YAML::Dump(eval $block->perl), <<'...', 'Regexps dump';
+# is YAML::Dump(eval $block->perl), <<"...", 'Regexps dump';
# ---
-# key: !!perl/regexp (?m-xis:foo$)
+# key: !!perl/regexp (?$m_xis:foo\$)
# ...
$re = $hash->{key};
@@ -48,11 +54,11 @@
$block = $blocks[2];
$hash = YAML::Load($block->yaml);
-is $hash->{key}, '(?-xism:foo$)', 'Regexps load';
+is $hash->{key}, "(?$_xism:foo\$)", 'Regexps load';
-is YAML::Dump(eval $block->perl), <<'...', 'Regexps dump';
+is YAML::Dump(eval $block->perl), <<"...", 'Regexps dump';
---
-key: !!perl/regexp (?-xism:foo$)
+key: !!perl/regexp (?$_xism:foo\$)
...
$re = $hash->{key};