typedef AV PADNAMELIST;
typedef SV PADNAME;
-#if !defined(PERL_OLD_COPY_ON_WRITE) && !defined(PERL_NEW_COPY_ON_WRITE) && !defined(PERL_NO_COW)
-# define PERL_NEW_COPY_ON_WRITE
-#endif
+/* XXX for 5.18, disable the COW by default
+ * #if !defined(PERL_OLD_COPY_ON_WRITE) && !defined(PERL_NEW_COPY_ON_WRITE) && !defined(PERL_NO_COW)
+ * # define PERL_NEW_COPY_ON_WRITE
+ * #endif
+ */
#if defined(PERL_OLD_COPY_ON_WRITE) || defined(PERL_NEW_COPY_ON_WRITE)
# if defined(PERL_OLD_COPY_ON_WRITE) && defined(PERL_NEW_COPY_ON_WRITE)
# else
# define PERL_ANY_COW
# endif
+#else
+# define PERL_SAWAMPERSAND
#endif
#include "handy.h"
=item *
-XXX
+The new copy-on-write mechanism that was introduced in 5.17.7 has now been
+disabled by default, since it was felt that there were two many rough
+edges for the 5.18 release. It is expected that it will be enabled by
+default for 5.20.
+
+This change also re-enables PL_sawampersand by default.
+
+It can be enabled in a perl build by running F<Configure> with
+B<-Accflags=-DPERL_NEW_COPY_ON_WRITE>, and we would encourage XS authors to
+try their code with such an enabled perl, and provide feedback.
+XXX need blurb, e.g. a reference to a new section in perlguts or perlxs
+explaining how XS authors should handle COW strings.
+
=back
{
# [perl #4289] First mention $& after a match
+ local $::TODO = "these tests fail without Copy-on-Write enabled";
fresh_perl_is(
'$_ = "abc"; /b/g; $_ = "hello"; print eval q|$&|, "\n"',
"b\n", {}, '$& first mentioned after match');