diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-12-02 09:52:36 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-12-02 17:45:06 -0800 |
commit | 7c7df8124bbdd7a0091f8ed82589548c8182f624 (patch) | |
tree | 149f87f652dbf365f7370dd1b5f5223f28fc213c /pp_sys.c | |
parent | 6cd32d3b3481cbe3a38da6bbdf70e01ffe99d05a (diff) | |
download | perl-7c7df8124bbdd7a0091f8ed82589548c8182f624.tar.gz |
Deprecate tie $handle without *
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -827,6 +827,10 @@ PP(pp_tie) case SVt_PVGV: case SVt_PVLV: if (isGV_with_GP(varsv)) { + if (SvFAKE(varsv) && !(GvFLAGS(varsv) & GVf_TIEWARNED)) { + deprecate("tie on a handle without *"); + GvFLAGS(varsv) |= GVf_TIEWARNED; + } methname = "TIEHANDLE"; how = PERL_MAGIC_tiedscalar; /* For tied filehandles, we apply tiedscalar magic to the IO @@ -903,8 +907,14 @@ PP(pp_untie) const char how = (SvTYPE(sv) == SVt_PVHV || SvTYPE(sv) == SVt_PVAV) ? PERL_MAGIC_tied : PERL_MAGIC_tiedscalar; - if (isGV_with_GP(sv) && !(sv = MUTABLE_SV(GvIOp(sv)))) + if (isGV_with_GP(sv)) { + if (SvFAKE(sv) && !(GvFLAGS(sv) & GVf_TIEWARNED)) { + deprecate("untie on a handle without *"); + GvFLAGS(sv) |= GVf_TIEWARNED; + } + if (!(sv = MUTABLE_SV(GvIOp(sv)))) RETPUSHYES; + } if ((mg = SvTIED_mg(sv, how))) { SV * const obj = SvRV(SvTIED_obj(sv, mg)); @@ -941,8 +951,14 @@ PP(pp_tied) const char how = (SvTYPE(sv) == SVt_PVHV || SvTYPE(sv) == SVt_PVAV) ? PERL_MAGIC_tied : PERL_MAGIC_tiedscalar; - if (isGV_with_GP(sv) && !(sv = MUTABLE_SV(GvIOp(sv)))) + if (isGV_with_GP(sv)) { + if (SvFAKE(sv) && !(GvFLAGS(sv) & GVf_TIEWARNED)) { + deprecate("tied on a handle without *"); + GvFLAGS(sv) |= GVf_TIEWARNED; + } + if (!(sv = MUTABLE_SV(GvIOp(sv)))) RETPUSHUNDEF; + } if ((mg = SvTIED_mg(sv, how))) { SV *osv = SvTIED_obj(sv, mg); |