This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PATCH: [perl #133988], Assertion failure
[perl5.git] / pod / perldiag.pod
index eb24f14..14ef8af 100644 (file)
@@ -2159,11 +2159,20 @@ unlikely to be what you want.
 
 =item Empty \%c in regex; marked by S<<-- HERE> in m/%s/
 
+=item Empty \%c{}
+
 =item Empty \%c{} in regex; marked by S<<-- HERE> in m/%s/
 
-(F) C<\p> and C<\P> are used to introduce a named Unicode property, as
-described in L<perlunicode> and L<perlre>.  You used C<\p> or C<\P> in
-a regular expression without specifying the property name.
+(F) You used something like C<\b{}>, C<\B{}>, C<\o{}>, C<\p>, C<\P>, or
+C<\x> without specifying anything for it to operate on.
+
+Unfortunately, for backwards compatibility reasons, an empty C<\x> is
+legal outside S<C<use re 'strict'>> and expands to a NUL character.
+
+=item Empty (?) without any modifiers in regex; marked by <-- HERE in m/%s/
+
+(W regexp) (only under C<S<use re 'strict'>>)
+C<(?)> does nothing, so perhaps this is a typo.
 
 =item ${^ENCODING} is no longer supported
 
@@ -4009,49 +4018,33 @@ probably not what you want.
 (F) Named Unicode character escapes (C<\N{...}>) may return a
 multi-character sequence.  Even though a character class is
 supposed to match just one character of input, perl will match the
-whole thing correctly, except when the class is inverted (C<[^...]>),
-or the escape is the beginning or final end point of a range.  The
-mathematically logical behavior for what matches when inverting
-is very different from what people expect, so we have decided to
-forbid it.  Similarly unclear is what should be generated when the
-C<\N{...}> is used as one of the end points of the range, such as in
+whole thing correctly, except under certain conditions.  These currently
+are
 
- [\x{41}-\N{ARABIC SEQUENCE YEH WITH HAMZA ABOVE WITH AE}]
-
-What is meant here is unclear, as the C<\N{...}> escape is a sequence
-of code points, so this is made an error.
-
-=item \N{NAME} must be resolved by the lexer in regex; marked by
-S<<-- HERE> in m/%s/
+=over 4
 
-(F) When compiling a regex pattern, an unresolved named character or
-sequence was encountered.  This can happen in any of several ways that
-bypass the lexer, such as using single-quotish context, or an extra
-backslash in double-quotish:
+=item When the class is inverted (C<[^...]>)
 
-    $re = '\N{SPACE}'; # Wrong!
-    $re = "\\N{SPACE}";        # Wrong!
-    /$re/;
+The mathematically logical behavior for what matches when inverting
+is very different from what people expect, so we have decided to
+forbid it.
 
-Instead, use double-quotes with a single backslash:
+=item The escape is the beginning or final end point of a range
 
-    $re = "\N{SPACE}"; # ok
-    /$re/;
+Similarly unclear is what should be generated when the
+C<\N{...}> is used as one of the end points of the range, such as in
 
-The lexer can be bypassed as well by creating the pattern from smaller
-components:
+ [\x{41}-\N{ARABIC SEQUENCE YEH WITH HAMZA ABOVE WITH AE}]
 
-    $re = '\N';
-    /${re}{SPACE}/;    # Wrong!
+What is meant here is unclear, as the C<\N{...}> escape is a sequence
+of code points, so this is made an error.
 
-It's not a good idea to split a construct in the middle like this, and
-it doesn't work here.  Instead use the solution above.
+=item In a regex set
 
-Finally, the message also can happen under the C</x> regex modifier when the
-C<\N> is separated by spaces from the C<{>, in which case, remove the spaces.
+The syntax S<C<(?[   ])>> in a regular expression yields a list of
+single code points, none can be a sequence.
 
-    /\N {SPACE}/x;     # Wrong!
-    /\N{SPACE}/x;      # ok
+=back
 
 =item No %s allowed while running setuid
 
@@ -4322,13 +4315,6 @@ supplied.  See L<perlform>.
 of Perl.  Check the #! line, or manually feed your script into Perl
 yourself.
 
-=item (?[...]) not valid in locale in regex; marked by S<<-- HERE> in m/%s/
-
-(F) C<(?[...])> cannot be used within the scope of a C<S<use locale>> or with
-an C</l> regular expression modifier, as that would require deferring
-to run-time the calculation of what it should evaluate to, and it is
-regex compile-time only.
-
 =item no UTC offset information; assuming local time is UTC
 
 (S) A warning peculiar to VMS.  Perl was unable to find the local
@@ -6317,6 +6303,15 @@ The message attempts to include the name of the called subroutine. If the
 subroutine has been aliased, the subroutine's original name will be shown,
 regardless of what name the caller used.
 
+=item Too many nested open parens in regex; marked by <-- HERE in m/%s/
+
+(F) You have exceeded the number of open C<"("> parentheses that haven't
+been matched by corresponding closing ones.  This limit prevents eating
+up too much memory.  It is initially set to 1000, but may be changed by
+setting C<${^RE_COMPILE_RECURSION_LIMIT}> to some other value.  This may
+need to be done in a BEGIN block before the regular expression pattern
+is compiled.
+
 =item Too many )'s
 
 (A) You've accidentally run your script through B<csh> instead of Perl.
@@ -7527,7 +7522,12 @@ front of your variable.
 
 =item Variable length lookbehind not implemented in regex m/%s/
 
-(F) Lookbehind is allowed only for subexpressions whose length is fixed and
+(F) B<This message no longer should be raised as of Perl 5.30.>  It is
+retained in this document as a convenience for people using an earlier
+Perl version.
+
+In Perl 5.30 and earlier, lookbehind is allowed
+only for subexpressions whose length is fixed and
 known at compile time.  For positive lookbehind, you can use the C<\K>
 regex construct as a way to get the equivalent functionality.  See
 L<(?<=pattern) and \K in perlre|perlre/\K>.