From d32207c9fde2dae3f943cff7b308d59eef63e106 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sun, 13 Feb 2011 21:37:48 -0800 Subject: [PATCH] =?utf8?q?perldiag:=20reflow=20=E2=80=98Missing=20right=20?= =?utf8?q?brace=20on=20\N{}=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit for ‘use diagnostics’ output on eighty-column terminals --- pod/perldiag.pod | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 54120b3..23f6e60 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -2645,30 +2645,29 @@ can vary from one line to the next. =item Missing right brace on \N{} or unescaped left brace after \N -(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. - -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 short for -C<[^\n]>, and like C<.> but is not affected by the C regex modifier.) - -This can lead to some ambiguities. When C<\N> is not followed immediately by a -left brace, Perl assumes the C<[^\n]> 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{> -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 C<[^\n]{> 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\{> +(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. + +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 short +for C<[^\n]>, and like C<.> but is not affected by the C regex modifier.) + +This can lead to some ambiguities. When C<\N> is not followed immediately +by a left brace, Perl assumes the C<[^\n]> 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{> 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 C<[^\n]{> 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 -- 1.8.3.1