From: Rafael Garcia-Suarez Date: Mon, 20 Jun 2005 11:00:31 +0000 (+0000) Subject: Remove the deprecated $# variable X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8ae1fe26cb95d1274fd14fd03b3c3d0928a2403f;p=p5sagit%2Fp5-mst-13.2.git Remove the deprecated $# variable p4raw-id: //depot/perl@24908 --- diff --git a/doio.c b/doio.c index 3a0bad0..7010238 100644 --- a/doio.c +++ b/doio.c @@ -1298,19 +1298,6 @@ Perl_do_print(pTHX_ register SV *sv, PerlIO *fp) /* assuming fp is checked earlier */ if (!sv) return TRUE; - if (PL_ofmt) { - if (SvGMAGICAL(sv)) - mg_get(sv); - if (SvIOK(sv) && SvIVX(sv) != 0) { - PerlIO_printf(fp, PL_ofmt, (NV)SvIVX(sv)); - return !PerlIO_error(fp); - } - if ( (SvNOK(sv) && SvNVX(sv) != 0.0) - || (looks_like_number(sv) && sv_2nv(sv) != 0.0) ) { - PerlIO_printf(fp, PL_ofmt, SvNVX(sv)); - return !PerlIO_error(fp); - } - } switch (SvTYPE(sv)) { case SVt_NULL: if (ckWARN(WARN_UNINITIALIZED)) diff --git a/embedvar.h b/embedvar.h index d0c3a46..2f3640a 100644 --- a/embedvar.h +++ b/embedvar.h @@ -330,7 +330,6 @@ #define PL_numeric_name (vTHX->Inumeric_name) #define PL_numeric_radix_sv (vTHX->Inumeric_radix_sv) #define PL_numeric_standard (vTHX->Inumeric_standard) -#define PL_ofmt (vTHX->Iofmt) #define PL_oldbufptr (vTHX->Ioldbufptr) #define PL_oldname (vTHX->Ioldname) #define PL_oldoldbufptr (vTHX->Ioldoldbufptr) @@ -634,7 +633,6 @@ #define PL_Inumeric_name PL_numeric_name #define PL_Inumeric_radix_sv PL_numeric_radix_sv #define PL_Inumeric_standard PL_numeric_standard -#define PL_Iofmt PL_ofmt #define PL_Ioldbufptr PL_oldbufptr #define PL_Ioldname PL_oldname #define PL_Ioldoldbufptr PL_oldoldbufptr diff --git a/gv.c b/gv.c index 68dbd72..31a1c82 100644 --- a/gv.c +++ b/gv.c @@ -1031,15 +1031,11 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags, goto magicalize; } case '*': - if (sv_type == SVt_PV && ckWARN2(WARN_DEPRECATED, WARN_SYNTAX)) - Perl_warner(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX), - "$* is no longer supported"); - break; case '#': if (sv_type == SVt_PV && ckWARN2(WARN_DEPRECATED, WARN_SYNTAX)) Perl_warner(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX), - "Use of $# is deprecated"); - goto magicalize; + "$%c is no longer supported", *name); + break; case '|': sv_setiv(GvSV(gv), (IV)(IoFLAGS(GvIOp(PL_defoutgv)) & IOf_FLUSH) != 0); goto magicalize; diff --git a/intrpvar.h b/intrpvar.h index 342d391..8a93f2a 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -180,7 +180,6 @@ PERLVAR(Imess_sv, SV *) /* XXX shouldn't these be per-thread? --GSAR */ PERLVAR(Iors_sv, SV *) /* output record separator $\ */ -PERLVAR(Iofmt, char *) /* output format for numbers $# */ /* interpreter atexit processing */ PERLVARI(Iexitlist, PerlExitListEntry *, NULL) diff --git a/mg.c b/mg.c index 36ee9d6..0b57734 100644 --- a/mg.c +++ b/mg.c @@ -879,9 +879,6 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) if (PL_ors_sv) sv_copypv(sv, PL_ors_sv); break; - case '#': - sv_setpv(sv,PL_ofmt); - break; case '!': #ifdef VMS sv_setnv(sv, (NV)((errno == EVMSERR) ? vaxc$errno : errno)); @@ -2293,11 +2290,6 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) PL_ofs_sv = Nullsv; } break; - case '#': - if (PL_ofmt) - Safefree(PL_ofmt); - PL_ofmt = savesvpv(sv); - break; case '[': PL_compiling.cop_arybase = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv); break; diff --git a/perl.c b/perl.c index 62b128a..45b8625 100644 --- a/perl.c +++ b/perl.c @@ -922,8 +922,6 @@ perl_destruct(pTHXx) Safefree(PL_psig_pend); PL_psig_pend = (int*)NULL; PL_formfeed = Nullsv; - Safefree(PL_ofmt); - PL_ofmt = Nullch; nuke_stacks(); PL_tainting = FALSE; PL_taint_warn = FALSE; diff --git a/perlapi.h b/perlapi.h index e6fe38f..5f3b37e 100644 --- a/perlapi.h +++ b/perlapi.h @@ -456,8 +456,6 @@ END_EXTERN_C #define PL_numeric_radix_sv (*Perl_Inumeric_radix_sv_ptr(aTHX)) #undef PL_numeric_standard #define PL_numeric_standard (*Perl_Inumeric_standard_ptr(aTHX)) -#undef PL_ofmt -#define PL_ofmt (*Perl_Iofmt_ptr(aTHX)) #undef PL_oldbufptr #define PL_oldbufptr (*Perl_Ioldbufptr_ptr(aTHX)) #undef PL_oldname diff --git a/pod/perldiag.pod b/pod/perldiag.pod index bfc1258..94c1fd4 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -2064,6 +2064,12 @@ neither as a system call or an ioctl call (SIOCATMARK). been removed as of 5.9.0 and is no longer supported. You should use the C and C regexp modifiers instead. +=item $# is no longer supported + +(D deprecated) The special variable C<$#>, deprecated in older perls, has +been removed as of 5.9.3 and is no longer supported. You should use the +printf/sprintf functions instead. + =item `%s' is not a code reference (W overload) The second (fourth, sixth, ...) argument of overload::constant @@ -4431,11 +4437,6 @@ C. (F) You attempted to use a feature of printf that is accessible from only C. This usually means there's a better way to do it in Perl. -=item Use of $# is deprecated - -(D deprecated) This was an ill-advised attempt to emulate a poorly -defined B feature. Use an explicit printf() or sprintf() instead. - =item Use of %s is deprecated (D deprecated) The construct indicated is no longer recommended for use, diff --git a/sv.c b/sv.c index 13e3f12..2d6d84d 100644 --- a/sv.c +++ b/sv.c @@ -11584,7 +11584,6 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags, PL_mess_sv = Nullsv; PL_ors_sv = sv_dup_inc(proto_perl->Iors_sv, param); - PL_ofmt = SAVEPV(proto_perl->Iofmt); /* interpreter atexit processing */ PL_exitlistlen = proto_perl->Iexitlistlen; diff --git a/t/lib/warnings/gv b/t/lib/warnings/gv index 36082b0..91c6ce1 100644 --- a/t/lib/warnings/gv +++ b/t/lib/warnings/gv @@ -8,7 +8,7 @@ @ISA = qw(Other) ; fred() ; - Use of $# is deprecated + $# is no longer supported $* is no longer supported $a = ${"#"} ; @@ -50,5 +50,5 @@ no warnings 'deprecated' ; $a = ${"#"}; $a = ${"*"}; EXPECT -Use of $# is deprecated at - line 3. +$# is no longer supported at - line 3. $* is no longer supported at - line 4.