In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/9af81bfe7273a3b8fb9a4bf495609d5da31c3fb4?hp=77649ca9d82a2e8cc65a4fcc0db2c41ca4daa6ce>
- Log ----------------------------------------------------------------- commit 9af81bfe7273a3b8fb9a4bf495609d5da31c3fb4 Author: Karl Williamson <[email protected]> Date: Tue Mar 6 09:07:46 2012 -0700 pods: Note future deprecation of unescaped "{" M Porting/perl5160delta.pod M pod/perlre.pod commit 1dc2b704631c7fdc4c58e877c2f17811dc72bc6f Author: Karl Williamson <[email protected]> Date: Sun Mar 4 12:33:03 2012 -0700 perllexwarn: Fix typos M pod/perllexwarn.pod ----------------------------------------------------------------------- Summary of changes: Porting/perl5160delta.pod | 17 +++++++++++++++++ pod/perllexwarn.pod | 4 ++-- pod/perlre.pod | 19 +++++++++++++++++-- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/Porting/perl5160delta.pod b/Porting/perl5160delta.pod index e55b6df..a117886 100644 --- a/Porting/perl5160delta.pod +++ b/Porting/perl5160delta.pod @@ -895,6 +895,23 @@ itself. C<substr> no longer calculates a value to return when called in void context. +=item Literal C<"{"> characters in regular expression patterns + +It is planned starting in v5.20 to require a literal C<"{"> to be +escaped by, for example, preceding it with a backslash. In v5.18, a +deprecated warning message will be emitted for all such uses. Note that +this only affects patterns which are to match a literal C<"{">. Other +uses of this character, such as part of a quantifier or sequence like in +the ones below are completely unaffected: + + /foo{3,5}/ + /\p{Alphabetic}/ + /\N{DIGIT ZERO} + +The removal of this will allow extensions to pattern syntax, and better +error checking of existing syntax. See L<perlre/Quantifiers> for an +example. + =back =over 4 diff --git a/pod/perllexwarn.pod b/pod/perllexwarn.pod index accbfdf..e631359 100644 --- a/pod/perllexwarn.pod +++ b/pod/perllexwarn.pod @@ -158,7 +158,7 @@ Does the exact opposite to the B<-W> flag, i.e. it disables all warnings. =head2 Backward Compatibility -If you are used with working with a version of Perl prior to the +If you are used to working with a version of Perl prior to the introduction of lexically scoped warnings, or have code that uses both lexical warnings and C<$^W>, this section will describe how they interact. @@ -169,7 +169,7 @@ How Lexical Warnings interact with B<-w>/C<$^W>: =item 1. If none of the three command line flags (B<-w>, B<-W> or B<-X>) that -control warnings is used and neither C<$^W> or the C<warnings> pragma +control warnings is used and neither C<$^W> nor the C<warnings> pragma are used, then default warnings will be enabled and optional warnings disabled. This means that legacy code that doesn't attempt to control the warnings diff --git a/pod/perlre.pod b/pod/perlre.pod index 772a8bc..b69c359 100644 --- a/pod/perlre.pod +++ b/pod/perlre.pod @@ -513,8 +513,23 @@ X<metacharacter> X<quantifier> X<*> X<+> X<?> X<{n}> X<{n,}> X<{n,m}> (If a curly bracket occurs in any other context and does not form part of a backslashed sequence like C<\x{...}>, it is treated -as a regular character. In particular, the lower bound -is not optional.) The "*" quantifier is equivalent to C<{0,}>, the "+" +as a regular character. In particular, the lower quantifier bound +is not optional. However, in Perl v5.18, it is planned to issue a +deprecation warning for all such occurrences, and in Perl v5.20 to +require literal uses of a curly bracket to be escaped, say by preceding +them with a backslash or enclosing them within square brackets, (C<"\{"> +or C<"[{]">). This change will allow for future syntax extensions (like +making the lower bound of a quantifier optional), and better error +checking of quantifiers. Now, a typo in a quantifier silently causes +it to be treated as the literal characters. For example, + + /o{4,3}/ + +looks like a quantifier that matches 0 times, since 4 is greater than 3, +but it really means to match the sequence of six characters +S<C<"o { 4 , 3 }">>.) + +The "*" quantifier is equivalent to C<{0,}>, the "+" quantifier to C<{1,}>, and the "?" quantifier to C<{0,1}>. n and m are limited to non-negative integral values less than a preset limit defined when perl is built. This is usually 32766 on the most common platforms. The actual limit can -- Perl5 Master Repository
