In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/4055dbce18d26660d937e0dea2aefbb2cd09478d?hp=e40f080eadb45b2fc0feee5109420f2f70c81ccd>
- Log ----------------------------------------------------------------- commit 4055dbce18d26660d937e0dea2aefbb2cd09478d Author: Ricardo Signes <[email protected]> Date: Wed Feb 20 11:40:45 2013 -0500 put an experimental warning on lexical topic M lib/warnings.pm M op.c M pod/perldelta.pod M pod/perldiag.pod M regen/warnings.pl M t/lib/warnings/9uninit M t/lib/warnings/op M warnings.h commit 55783725fcd6f6dcc5b3ecc5d7727d7ee3bda8a8 Author: Ricardo Signes <[email protected]> Date: Wed Feb 20 11:34:06 2013 -0500 update release schedule for a volunteer M Porting/release_schedule.pod ----------------------------------------------------------------------- Summary of changes: Porting/release_schedule.pod | 2 +- lib/warnings.pm | 21 ++++++++++++--------- op.c | 7 +++++++ pod/perldelta.pod | 3 ++- pod/perldiag.pod | 12 ++++++++++++ regen/warnings.pl | 2 ++ t/lib/warnings/9uninit | 3 ++- t/lib/warnings/op | 14 ++++++++++++++ warnings.h | 3 ++- 9 files changed, 54 insertions(+), 13 deletions(-) diff --git a/Porting/release_schedule.pod b/Porting/release_schedule.pod index 0922bf6..3b35578 100644 --- a/Porting/release_schedule.pod +++ b/Porting/release_schedule.pod @@ -78,7 +78,7 @@ you should reset the version numbers to the next blead series. 2013-05-20 5.19.0 2013-06-20 5.19.1 David Golden 2013-07-20 5.19.2 - 2013-08-20 5.19.3 + 2013-08-20 5.19.3 Steve Hay 2013-09-20 5.19.4 2013-10-20 5.19.5 2013-11-20 5.19.6 diff --git a/lib/warnings.pm b/lib/warnings.pm index cafda2d..c0c2cc9 100644 --- a/lib/warnings.pm +++ b/lib/warnings.pm @@ -230,11 +230,12 @@ our %Offsets = ( 'experimental' => 102, 'experimental::lexical_subs'=> 104, - 'experimental::regex_sets'=> 106, + 'experimental::lexical_topic'=> 106, + 'experimental::regex_sets'=> 108, ); our %Bits = ( - 'all' => "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x05", # [0..53] + 'all' => "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15", # [0..54] 'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00", # [29] 'bareword' => "\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00", # [30] 'closed' => "\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6] @@ -244,9 +245,10 @@ our %Bits = ( 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00", # [31] 'exec' => "\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7] 'exiting' => "\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3] - 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x05", # [51..53] + 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x15", # [51..54] 'experimental::lexical_subs'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", # [52] - 'experimental::regex_sets'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04", # [53] + 'experimental::lexical_topic'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04", # [53] + 'experimental::regex_sets'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10", # [54] 'glob' => "\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4] 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00", # [47] 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00", # [46] @@ -291,7 +293,7 @@ our %Bits = ( ); our %DeadBits = ( - 'all' => "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\x0a", # [0..53] + 'all' => "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\x2a", # [0..54] 'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00", # [29] 'bareword' => "\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00", # [30] 'closed' => "\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6] @@ -301,9 +303,10 @@ our %DeadBits = ( 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00", # [31] 'exec' => "\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7] 'exiting' => "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3] - 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x0a", # [51..53] + 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x2a", # [51..54] 'experimental::lexical_subs'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", # [52] - 'experimental::regex_sets'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08", # [53] + 'experimental::lexical_topic'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08", # [53] + 'experimental::regex_sets'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20", # [54] 'glob' => "\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4] 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00", # [47] 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00", # [46] @@ -348,8 +351,8 @@ our %DeadBits = ( ); $NONE = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; -$DEFAULT = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x00\x05", # [2,52,53,4,22,23,25] -$LAST_BIT = 108 ; +$DEFAULT = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x00\x15", # [2,52..54,4,22,23,25] +$LAST_BIT = 110 ; $BYTES = 14 ; $All = "" ; vec($All, $Offsets{'all'}, 2) = 3 ; diff --git a/op.c b/op.c index 1d676c4..91b9d5d 100644 --- a/op.c +++ b/op.c @@ -578,6 +578,13 @@ Perl_allocmy(pTHX_ const char *const name, const STRLEN len, const U32 flags) PL_parser->in_my == KEY_state ? "state" : "my"), flags & SVf_UTF8); } } + else if (len == 2 && name[1] == '_' && !is_our) + /* diag_listed_as: Use of my $_ is experimental */ + Perl_ck_warner_d(aTHX_ packWARN(WARN_EXPERIMENTAL__LEXICAL_TOPIC), + "Use of %s $_ is experimental", + PL_parser->in_my == KEY_state + ? "state" + : "my"); /* allocate a spare slot and store the name in that slot */ diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 9443db3..eb7b69c 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -35,7 +35,8 @@ This release reverts that change. =head1 Deprecations -The premature deprecation of lexical $_ in 5.17.7 has been reverted. +The deprecation of lexical C<$_> in 5.17.7 has been commuted. The feature +is now marked experimental. =head2 Deprecated pragma diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 9ec4446..3a76c76 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -5702,6 +5702,12 @@ old way has bad side effects. it already went past any symlink you are presumably trying to look for. The operation returned C<undef>. Use a filename instead. +=item Use of my $_ is experimental + +(S experimental::lexical_topic) Lexical $_ is an experimental feature and +its behavior may change or even be removed in any future release of perl. +See the explanation under L<perlvar/$_>. + =item Use of %s on a handle without * is deprecated (D deprecated) You used C<tie>, C<tied> or C<untie> on a scalar but that scalar @@ -5733,6 +5739,12 @@ C<$array[0+$ref]>. This warning is not given for overloaded objects, however, because you can overload the numification and stringification operators and then you presumably know what you are doing. +=item Use of state $_ is experimental + +(S experimental::lexical_topic) Lexical $_ is an experimental feature and +its behavior may change or even be removed in any future release of perl. +See the explanation under L<perlvar/$_>. + =item Use of tainted arguments in %s is deprecated (W taint, deprecated) You have supplied C<system()> or C<exec()> with multiple diff --git a/regen/warnings.pl b/regen/warnings.pl index 93b26fe..94a9843 100644 --- a/regen/warnings.pl +++ b/regen/warnings.pl @@ -89,6 +89,8 @@ my $tree = { [ 5.017, DEFAULT_ON ], 'experimental::regex_sets' => [ 5.017, DEFAULT_ON ], + 'experimental::lexical_topic' => + [ 5.017, DEFAULT_ON ], }], #'default' => [ 5.008, DEFAULT_ON ], diff --git a/t/lib/warnings/9uninit b/t/lib/warnings/9uninit index fb9a487..f74b7e3 100644 --- a/t/lib/warnings/9uninit +++ b/t/lib/warnings/9uninit @@ -787,7 +787,7 @@ s/$m1/$g1/; undef $_; tr/x/y/; undef $_; tr/x/y/r; undef $_; - +my $_; /y/; /$m1/; /$g1/; @@ -820,6 +820,7 @@ undef $g1; $m1 = '$g1'; $foo =~ s//$m1/ee; EXPECT +Use of my $_ is experimental at - line 16. Use of uninitialized value $_ in pattern match (m//) at - line 5. Use of uninitialized value $m1 in regexp compilation at - line 6. Use of uninitialized value $_ in pattern match (m//) at - line 6. diff --git a/t/lib/warnings/op b/t/lib/warnings/op index 3e9ea41..c5cbbc3 100644 --- a/t/lib/warnings/op +++ b/t/lib/warnings/op @@ -1,5 +1,8 @@ op.c AOK + Use of my $_ is experimental + my $_ ; + Found = in conditional, should be == 1 if $a = 1 ; @@ -104,6 +107,17 @@ __END__ # op.c +use warnings 'experimental::lexical_topic' ; +my $_; +CORE::state $_; +no warnings 'experimental::lexical_topic' ; +my $_; +CORE::state $_; +EXPECT +Use of my $_ is experimental at - line 3. +Use of state $_ is experimental at - line 4. +######## +# op.c use warnings 'syntax' ; 1 if $a = 1 ; 1 if $a diff --git a/warnings.h b/warnings.h index 3133df0..d0bf710 100644 --- a/warnings.h +++ b/warnings.h @@ -91,7 +91,8 @@ #define WARN_EXPERIMENTAL 51 #define WARN_EXPERIMENTAL__LEXICAL_SUBS 52 -#define WARN_EXPERIMENTAL__REGEX_SETS 53 +#define WARN_EXPERIMENTAL__LEXICAL_TOPIC 53 +#define WARN_EXPERIMENTAL__REGEX_SETS 54 #define WARNsize 14 #define WARN_ALLstring "\125\125\125\125\125\125\125\125\125\125\125\125\125\125" -- Perl5 Master Repository
