remove deprecated *glob{FILEHANDLE} #15105
Comments
From @rjbsCreated by @rjbsUsing *glob{FILEHANDLE} instead of *glob{IO} was intended to be This behavior has been issuing a warning since then, and it has been I'm not sure there's an obvious way forward here, but I would like to 1) drop the behavior entirely, letting it return undef like any other 2) make it fatal 3) leave it warning but working Perl Info
|
From @AbigailOn Mon, Dec 28, 2015 at 12:34:32PM -0800, Ricardo SIGNES wrote:
There's also a fourth option: 4) drop the warning, and leave it working. If it was intended to be deprecated almost 20 years ago, and was I think having something deprecated for a long time, but all what's IMO, if something is deprecated, there should be a date attached. Labelling features as deprecated, but then not deprecating them, will If p5p doesn't take deprecation warnings seriously, why should users? Abigail |
The RT System itself - Status changed from 'new' to 'open' |
From @rjbs* Abigail via RT <perlbug-followup@perl.org> [2015-12-28T17:05:25]
Yeah, and I think this is a pretty reasonable option. I meant to include it, *glob{FILEHANDLE} irritates me, but only when I notice that it's there. Is
I agree, generally. Even if there is no date, it should be revisited
Agreed, and that's why I brought this up! -- |
From @ap* Abigail <abigail@abigail.be> [2015-12-28 23:05]:
4b) but document it as discouraged
It’s probably one of these things that fell merely under “we don’t like
Yeah. Regards, |
From @rjbs* Abigail <abigail@abigail.be> [2015-12-28T17:04:39]
Patch attached. Thoughts, folks? -- |
From @rjbs0001-glob-FILEHANDLE-is-no-longer-deprecated.patchFrom 97f82b9c9d336ca942bdd8f40d5aef723716e47c Mon Sep 17 00:00:00 2001
From: Ricardo Signes <rjbs@cpan.org>
Date: Thu, 31 Dec 2015 21:54:49 -0500
Subject: [PATCH] *glob{FILEHANDLE} is no longer deprecated
---
pod/perlref.pod | 5 +++--
pp.c | 2 --
t/op/gv.t | 4 +++-
t/uni/gv.t | 4 +++-
4 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/pod/perlref.pod b/pod/perlref.pod
index 5804c17..1546c61 100644
--- a/pod/perlref.pod
+++ b/pod/perlref.pod
@@ -272,8 +272,9 @@ the IO handle, used for file handles (L<perlfunc/open>), sockets
(L<perlfunc/socket> and L<perlfunc/socketpair>), and directory
handles (L<perlfunc/opendir>). For compatibility with previous
versions of Perl, C<*foo{FILEHANDLE}> is a synonym for C<*foo{IO}>, though it
-is deprecated as of 5.8.0. If deprecation warnings are in effect, it will warn
-of its use.
+is discouraged, to encourage a consistent use of one name: IO. On perls
+between v5.8.0 and v5.22.0, it will issue a deprecation warning, but this
+deprecation has been rescinded.
C<*foo{THING}> returns undef if that particular THING hasn't been used yet,
except in the case of scalars. C<*foo{SCALAR}> returns a reference to an
diff --git a/pp.c b/pp.c
index 7071478..016023e 100644
--- a/pp.c
+++ b/pp.c
@@ -675,8 +675,6 @@ PP(pp_gelem)
break;
case 'F':
if (len == 10 && strEQ(second_letter, "ILEHANDLE")) {
- /* finally deprecated in 5.8.0 */
- deprecate("*glob{FILEHANDLE}");
tmpRef = MUTABLE_SV(GvIOp(gv));
}
else
diff --git a/t/op/gv.t b/t/op/gv.t
index 2c9cc64..6fd869c 100644
--- a/t/op/gv.t
+++ b/t/op/gv.t
@@ -182,7 +182,9 @@ is (*{*x{GLOB}}, "*main::STDOUT");
$warn .= $_[0];
};
my $val = *x{FILEHANDLE};
- print {*x{IO}} ($warn =~ /is deprecated/
+
+ # deprecation warning removed in v5.23 -- rjbs, 2015-12-31
+ print {*x{IO}} (! defined $warn
? "ok $test\n" : "not ok $test\n");
curr_test(++$test);
}
diff --git a/t/uni/gv.t b/t/uni/gv.t
index 89905fd..7557ffb 100644
--- a/t/uni/gv.t
+++ b/t/uni/gv.t
@@ -190,7 +190,9 @@ is (*{*Ẋ{GLOB}}, "*main::STDOUT");
$warn .= $_[0];
};
my $val = *Ẋ{FILEHANDLE};
- print {*Ẋ{IO}} ($warn =~ /is deprecated/
+
+ # deprecation warning removed in v5.23 -- rjbs, 2015-12-31
+ print {*Ẋ{IO}} (! defined $warn
? "ok $test\n" : "not ok $test\n");
curr_test(++$test);
}
--
2.6.4
|
From @cpansproutOn Thu Dec 31 19:13:48 2015, perl.p5p@rjbs.manxome.org wrote:
Looks good to me. -- Father Chrysostomos |
From @jkeenanOn Thu Dec 31 19:13:48 2015, perl.p5p@rjbs.manxome.org wrote:
-- |
From @jkeenanOn Thu Dec 31 19:13:48 2015, perl.p5p@rjbs.manxome.org wrote:
Recommend including the RT number in inline comments and commit message. -- |
From @AbigailOn Thu, Dec 31, 2015 at 10:13:22PM -0500, Ricardo Signes wrote:
Looks almost good to me:
but this line suggests the warning is gone in 5.22.1, which I don't On perls since v.5.8.0, it will issue a deprecation warning, but Or use the more math-like open ended interval: On perls from v5.8.0, and before v5.23.0, it will ... Or perhaps the easiest is to drop the '.0' altogether, and just use 5.8 Abigail |
@rjbs - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#127060 (status was 'resolved')
Searchable as RT127060$
The text was updated successfully, but these errors were encountered: