From 68ef19bb9eb24fa24f8c7ecfd08a99a0f2831d28 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Fri, 13 May 2011 08:24:16 -0700 Subject: [PATCH] =?utf8?q?Revert=20=E2=80=98Deprecate=20tie=20$handle=20wi?= =?utf8?q?thout=20*=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This reverts commit 7c7df8124bbdd7a0091f8ed82589548c8182f624, except for the perldiag entry, which we still need for splain’s sake. --- gv.h | 3 --- pp_sys.c | 20 ++------------------ t/op/tie.t | 23 ----------------------- 3 files changed, 2 insertions(+), 44 deletions(-) diff --git a/gv.h b/gv.h index ab5c788..a70a906 100644 --- a/gv.h +++ b/gv.h @@ -145,9 +145,6 @@ Return the SV from the GV. #define GVf_IMPORTED_HV 0x40 #define GVf_IMPORTED_CV 0x80 -/* Temporary flag for the tie $handle deprecation warnings. */ -#define GVf_TIEWARNED 0x100 - #define GvINTRO(gv) (GvFLAGS(gv) & GVf_INTRO) #define GvINTRO_on(gv) (GvFLAGS(gv) |= GVf_INTRO) #define GvINTRO_off(gv) (GvFLAGS(gv) &= ~GVf_INTRO) diff --git a/pp_sys.c b/pp_sys.c index aa74cef..98c3cf2 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -837,10 +837,6 @@ 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 @@ -917,14 +913,8 @@ 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)) { - if (SvFAKE(sv) && !(GvFLAGS(sv) & GVf_TIEWARNED)) { - deprecate("untie on a handle without *"); - GvFLAGS(sv) |= GVf_TIEWARNED; - } - if (!(sv = MUTABLE_SV(GvIOp(sv)))) + if (isGV_with_GP(sv) && !(sv = MUTABLE_SV(GvIOp(sv)))) RETPUSHYES; - } if ((mg = SvTIED_mg(sv, how))) { SV * const obj = SvRV(SvTIED_obj(sv, mg)); @@ -961,14 +951,8 @@ 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)) { - if (SvFAKE(sv) && !(GvFLAGS(sv) & GVf_TIEWARNED)) { - deprecate("tied on a handle without *"); - GvFLAGS(sv) |= GVf_TIEWARNED; - } - if (!(sv = MUTABLE_SV(GvIOp(sv)))) + if (isGV_with_GP(sv) && !(sv = MUTABLE_SV(GvIOp(sv)))) RETPUSHUNDEF; - } if ((mg = SvTIED_mg(sv, how))) { SV *osv = SvTIED_obj(sv, mg); diff --git a/t/op/tie.t b/t/op/tie.t index 0b53b14..8e17d16 100644 --- a/t/op/tie.t +++ b/t/op/tie.t @@ -925,29 +925,6 @@ fileno FOO; tie @a, "FOO" EXPECT Can't locate object method "TIEARRAY" via package "FOO" at - line 5. ######## - -# Deprecation warnings for tie $handle - -use warnings 'deprecated'; -$SIG{__WARN__} = sub { $w = shift }; -$handle = *foo; -eval { tie $handle, "" }; -print $w =~ /^Use of tie on a handle without \* is deprecated/ - ? "ok tie\n" : "$w\n"; -$handle = *bar; -tied $handle; -print $w =~ /^Use of tied on a handle without \* is deprecated/ - ? "ok tied\n" : "$w\n"; -$handle = *baz; -untie $handle; -print $w =~ /^Use of untie on a handle without \* is deprecated/ - ? "ok untie\n" : "$w\n"; - -EXPECT -ok tie -ok tied -ok untie -######## # # STORE freeing tie'd AV sub TIEARRAY { bless [] } -- 2.7.4