This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix for bug: [perl #32562] __PACKAGE__ symbol has wrong value
[perl5.git] / toke.c
diff --git a/toke.c b/toke.c
index a7a9068..d798946 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -4305,7 +4305,7 @@ Perl_yylex(pTHX)
        case KEY___PACKAGE__:
            yylval.opval = (OP*)newSVOP(OP_CONST, 0,
                                        (PL_curstash
-                                        ? newSVsv(PL_curstname)
+                                        ? newSVpv(HvNAME(PL_curstash), 0)
                                         : &PL_sv_undef));
            TERM(THING);