else if (*name == '-' || *name == '+')
require_tie_mod(gv, name, newSVpvs("Tie::Hash::NamedCapture"), "TIEHASH", 0);
} else if (sv_type == SVt_PV) {
- if (*name == '*' || *name == '#') {
- /* diag_listed_as: $* is no longer supported */
+ if (*name == '*') {
Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED,
WARN_SYNTAX),
- "$%c is no longer supported", *name);
+ "$* is no longer supported, and will become a syntax error");
+ } else if (*name == '#') {
+ Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED,
+ WARN_SYNTAX),
+ "$# is no longer supported");
}
}
if (sv_type==SVt_PV || sv_type==SVt_PVGV) {
break;
}
case '*': /* $* */
+ if (sv_type == SVt_PV)
+ Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX),
+ "$* is no longer supported, and will become a syntax error");
+ break;
case '#': /* $# */
if (sv_type == SVt_PV)
- /* diag_listed_as: $* is no longer supported */
Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX),
- "$%c is no longer supported", *name);
+ "$# is no longer supported");
break;
case '\010': /* $^H */
{
=item *
-L<$* is no longer supported|perldiag/"$* is no longer supported">
+L<$* is no longer supported, and will become a syntax error|perldiag/"$* is no longer supported, and will become a syntax error">
The warning that use of C<$*> and C<$#> is no longer supported is now
generated for every location that references them. Previously it would fail
(F) Your machine doesn't implement the sockatmark() functionality,
neither as a system call nor an ioctl call (SIOCATMARK).
-=item $* is no longer supported
+=item $* is no longer supported, and will become a syntax error
-(D deprecated, syntax) The special variable C<$*>, deprecated in older
-perls, has been removed as of 5.9.0 and is no longer supported. In
-previous versions of perl the use of C<$*> enabled or disabled multi-line
-matching within a string.
+(D deprecated, syntax) The special variable C<$*>, which has had no
+effect since v5.10.0, will be removed soon. Currently code which mentions
+this variable compiles with this warning, but the variable is no longer
+magical, hence reads and writes have no side effects. In future such code
+will fail to compile with a syntax error.
+
+Prior to v5.10.0 the use of C<$*> enabled or disabled multi-line matching
+within a string.
Instead of using C<$*> you should use the C</m> (and maybe C</s>) regexp
modifiers. You can enable C</m> for a lexical scope (even a whole file)
use warnings "void";
$#;
EXPECT
-$* is no longer supported at - line 3.
+$* is no longer supported, and will become a syntax error at - line 3.
$# is no longer supported at - line 5.
Useless use of a variable in void context at - line 5.
########
no warnings "void";
$#;
EXPECT
-$* is no longer supported at - line 3.
+$* is no longer supported, and will become a syntax error at - line 3.
$# is no longer supported at - line 5.
$a = ${"*"};
EXPECT
$# is no longer supported at - line 2.
-$* is no longer supported at - line 3.
+$* is no longer supported, and will become a syntax error at - line 3.
########
# gv.c
$a = ${#};
$a = ${*};
EXPECT
$# is no longer supported at - line 2.
-$* is no longer supported at - line 3.
+$* is no longer supported, and will become a syntax error at - line 3.
########
# gv.c
$a = $#;
$a = \$*;
EXPECT
$# is no longer supported at - line 2.
-$* is no longer supported at - line 3.
+$* is no longer supported, and will become a syntax error at - line 3.
$# is no longer supported at - line 4.
-$* is no longer supported at - line 5.
+$* is no longer supported, and will become a syntax error at - line 5.
$# is no longer supported at - line 6.
-$* is no longer supported at - line 7.
+$* is no longer supported, and will become a syntax error at - line 7.
########
# gv.c
@a = @#;
$a = $*;
EXPECT
$# is no longer supported at - line 4.
-$* is no longer supported at - line 5.
+$* is no longer supported, and will become a syntax error at - line 5.
########
# gv.c
$a = $#;
@a = @*;
EXPECT
$# is no longer supported at - line 2.
-$* is no longer supported at - line 3.
+$* is no longer supported, and will become a syntax error at - line 3.
########
# gv.c
use warnings 'syntax' ;