diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-08-26 06:20:01 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-08-26 08:24:20 -0700 |
commit | f132ae694cadce5cea5b006969b9b9ad169ecf64 (patch) | |
tree | 17870ff80fdfd752b80df30ac27e24d22878bcc9 /pp.c | |
parent | a12b8f3cd0656f16670bb2f2237cb55165d464e6 (diff) | |
download | perl-f132ae694cadce5cea5b006969b9b9ad169ecf64.tar.gz |
Make *{undef} self-consistent
Commit afd1915d made filehandle vivification work on hash and array
elements, but in doing so it accidentally changed
*{;undef} = 3;
to do the same thing as
*{""} = 3;
while leaving
*{$some_undefined_variable}
an error.
This commit adjusts the if() conditions in S_rv2gv (formerly in
pp_rv2gv) in pp.c to make PL_sv_undef follow the same path as before.
It also removes the uninit tests from lib/warnings/pp, since they
are now errors. The uninit warning in rv2gv is only triggered now
when it is implicit, as in close(). That is already tested in
lib/warnings/9uninit.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -176,11 +176,11 @@ S_rv2gv(pTHX_ SV *sv, const bool vivify_sv, const bool strict, } else { if (!isGV_with_GP(sv)) { - if (!SvOK(sv) && sv != &PL_sv_undef) { + if (!SvOK(sv)) { /* If this is a 'my' scalar and flag is set then vivify * NI-S 1999/05/07 */ - if (vivify_sv) { + if (vivify_sv && sv != &PL_sv_undef) { GV *gv; if (SvREADONLY(sv)) Perl_croak_no_modify(aTHX); |