From: Father Chrysostomos Date: Mon, 14 Feb 2011 05:37:48 +0000 (-0800) Subject: perldiag: reflow ‘Missing right brace on \N{}’ X-Git-Tag: v5.13.10~254 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/d32207c9fde2dae3f943cff7b308d59eef63e106 perldiag: reflow ‘Missing right brace on \N{}’ for ‘use diagnostics’ output on eighty-column terminals --- 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