This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Store the package name as a shared HEK.
[perl5.git] / pp.c
diff --git a/pp.c b/pp.c
index 2a543b3..f63b372 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -601,7 +601,8 @@ PP(pp_gelem)
        case 'P':
            if (strEQ(elem2, "ACKAGE")) {
                const char *name = HvNAME_get(GvSTASH(gv));
-               sv = newSVpv(name ? name : "__ANON__", 0);
+               sv = newSVpvn(name ? name : "__ANON__",
+                             name ? HvNAMELEN_get(GvSTASH(gv)) : 8);
            }
            break;
        case 'S':