Forgotten deprecation of *glob{FILEHANDLE}?
Message-Id: <
20010923033252.33085.qmail@onion.perl.org>
p4raw-id: //depot/perl@12153
(D deprecated) You are now encouraged to use the explicitly quoted form
if you wish to use an empty line as the terminator of the here-document.
+=item Use of *glob{FILEHANDLE} is deprecated
+
+(D deprecated) You are now encouraged to use the shorter *glob{IO} form
+to access the filehandle slot within a typeglob.
+
=item Use of implicit split to @_ is deprecated
(D deprecated) It makes a lot of work for the compiler when you clobber
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}>.
+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.
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
tmpRef = (SV*)GvCVu(gv);
break;
case 'F':
- if (strEQ(elem, "FILEHANDLE")) /* XXX deprecate in 5.005 */
+ if (strEQ(elem, "FILEHANDLE")) {
+ /* finally deprecated in 5.8.0 */
+ deprecate("*glob{FILEHANDLE}");
tmpRef = (SV*)GvIOp(gv);
+ }
else
if (strEQ(elem, "FORMAT"))
tmpRef = (SV*)GvFORM(gv);
*x = *STDOUT;
print *{*x{GLOB}} eq "*main::STDOUT" ? "ok 22\n" : "not ok 22\n";
print {*x{IO}} "ok 23\n";
-print {*x{FILEHANDLE}} "ok 24\n";
+
+{
+ my $warn;
+ local $SIG{__WARN__} = sub {
+ $warn .= $_[0];
+ };
+ my $val = *x{FILEHANDLE};
+ print {*x{IO}} ($warn =~ /is deprecated/ ? "ok 24\n" : "not ok 24\n");
+
+}
# test if defined() doesn't create any new symbols