develooper Front page | perl.perl5.porters | Postings from October 2013

Why does undef *gv vivify a scalar?

Thread Next
From:
Father Chrysostomos
Date:
October 26, 2013 09:29
Subject:
Why does undef *gv vivify a scalar?
Message ID:
20131026092858.7980.qmail@lists-nntp.develooper.com
I thought PERL_DONT_CREATE_GVSV (the default) allowed the SV slot to
be null internally.  pp_undef has this:

            gp_free(MUTABLE_GV(sv));
            Newxz(gp, 1, GP);
            GvGP_set(sv, gp_ref(gp));
            GvSV(sv) = newSV(0);         <--- note this line
            GvLINE(sv) = CopLINE(PL_curcop);
            GvEGV(sv) = MUTABLE_GV(sv);
            GvMULTI_on(sv);

Was this an oversight?


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About