summaryrefslogtreecommitdiff
path: root/pod/perldiag.pod
diff options
context:
space:
mode:
authorKarl Williamson <khw@khw-desktop.(none)>2010-02-18 15:06:51 -0700
committerRafael Garcia-Suarez <rgs@consttype.org>2010-02-19 10:10:46 +0100
commit0a96133fa53fe1b2ee03b5cce4cdd9c7c96a0867 (patch)
treeb016da4794f891725cf23111af55d1a5f5261d52 /pod/perldiag.pod
parentff3f963aa0f95ea53996b6a3842b824504b57c79 (diff)
downloadperl-0a96133fa53fe1b2ee03b5cce4cdd9c7c96a0867.tar.gz
Make a missing right brace on \N{ fatal
It was decided that this should be a fatal error instead of a warning. Also some comments were updated..
Diffstat (limited to 'pod/perldiag.pod')
-rw-r--r--pod/perldiag.pod30
1 files changed, 15 insertions, 15 deletions
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 486a5156a5..4a1288955e 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -2512,32 +2512,32 @@ can vary from one line to the next.
(F) Missing right brace in C<\x{...}>, C<\p{...}>, C<\P{...}>, or C<\N{...}>.
-=item Missing right brace on \\N{} or unescaped left brace after \\N. Assuming the latter
+=item Missing right brace on \\N{} or unescaped left brace after \\N
-(W syntax)
-C<\N> has traditionally been followed by a name enclosed in braces,
-meaning the character (or sequence of characters) given by that name.
+(F)
+C<\N> has two meanings.
+
+The traditional one has it followed by a name enclosed
+in braces, meaning the character (or sequence of characters) given by that name.
Thus C<\N{ASTERISK}> is another way of writing C<*>, valid in both
-double-quoted strings and regular expression patterns.
-In patterns, it doesn't have the meaning an unescaped C<*> does.
+double-quoted strings and regular expression patterns. In patterns, it doesn't
+have the meaning an unescaped C<*> does.
-Starting in Perl 5.12.0, C<\N> also can have an additional meaning in patterns,
-namely to match a non-newline character. (This is like C<.> but is not
-affected by the C</s> modifier.)
+Starting in Perl 5.12.0, C<\N> also can have an additional meaning (only) in
+patterns, namely to match a non-newline character. (This is like C<.> but is
+not affected by the C</s> modifier.)
This can lead to some ambiguities. When C<\N> is not followed immediately by a
left brace, Perl assumes the "match non-newline character" meaning. Also, if
the braces form a valid quantifier such as C<\N{3}> or C<\N{5,}>, Perl assumes
that this means to match the given quantity of non-newlines (in these examples,
-3, and 5 or more, respectively). In all other case, where there is a C<\N{>
+3; and 5 or more, respectively). In all other case, where there is a C<\N{>
and a matching C<}>, Perl assumes that a character name is desired.
However, if there is no matching C<}>, Perl doesn't know if it was mistakenly
-omitted, or if "match non-newline" followed by "match a C<{>" was desired.
-It assumes the latter because that is actually a valid interpretation as
-written, unlike the other case. If you meant the former, you need to add the
-matching right brace. If you did mean the latter, you can silence this warning
-by writing instead C<\N\{>.
+omitted, or if "match non-newline" followed by "match a C<{>" was desired, and
+raises this error. If you meant the former, add the right brace; if you meant
+the latter, escape the brace with a backslash, like so: C<\N\{>
=item Missing right curly or square bracket