This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Shorter source code in pp_gelem. (But it compiles to the same size)
authorNicholas Clark <nick@ccl4.org>
Sun, 9 Jan 2005 23:42:25 +0000 (23:42 +0000)
committerNicholas Clark <nick@ccl4.org>
Sun, 9 Jan 2005 23:42:25 +0000 (23:42 +0000)
p4raw-id: //depot/perl@23774

pp.c

diff --git a/pp.c b/pp.c
index c0212b9..69d8e18 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -597,10 +597,8 @@ PP(pp_gelem)
            break;
        case 'P':
            if (strEQ(elem2, "ACKAGE")) {
-               if (HvNAME(GvSTASH(gv)))
-                   sv = newSVpv(HvNAME(GvSTASH(gv)), 0);
-               else
-                   sv = newSVpv("__ANON__",0);
+               char *name = HvNAME(GvSTASH(gv));
+               sv = newSVpv(name ? name : "__ANON__", 0);
            }
            break;
        case 'S':