$sname = $name;
}
else {
- $sname = $s->_dump($name eq 'main::' ? '' : $name, "");
+ $sname = $s->_dump(
+ $name eq 'main::' || $] < 5.007 && $name eq "main::\0"
+ ? ''
+ : $name,
+ "",
+ );
$sname = '{' . $sname . '}';
}
if ($s->{purity}) {
if(i) ++c, --i; /* just get the name */
if (i >= 6 && strncmp(c, "main::", 6) == 0) {
c += 4;
- if (i == 6) i = 0; else i -= 4;
+#if PERL_VERSION < 7
+ if (i == 6 || (i == 7 && c[6] == '\0'))
+#else
+ if (i == 6)
+#endif
+ i = 0; else i -= 4;
}
if (needs_quote(c,i)) {
#ifdef GvNAMEUTF8
no strict 'refs';
is eval(Dumper \*{"foo::b\0ar"}), \*{"foo::b\0ar"},
'GVs with nulls';
- is eval Dumper(\*{chr 256}), \*{chr 256},
+ # There is a strange 5.6 bug that causes the eval to fail a supposed
+ # strict vars test (involving $VAR1). Mentioning the glob beforehand
+ # somehow makes it go away.
+ () = \*{chr 256};
+ is eval Dumper(\*{chr 256})||die ($@), \*{chr 256},
'GVs with UTF8 names (or not, depending on perl version)';
+ () = \*{"\0".chr 256}; # same bug
is eval Dumper(\*{"\0".chr 256}), \*{"\0".chr 256},
'GVs with UTF8 and nulls';
};