perldiag: Expand the ‘Unknown switch condition’ description
authorFather Chrysostomos <sprout@cpan.org>
Mon, 14 Feb 2011 22:33:43 +0000 (14:33 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 15 Feb 2011 00:19:07 +0000 (16:19 -0800)
Actually, I’m abbreviating much of the existing text, but there are so
many possible conditions now it seems like a good idea.

pod/perldiag.pod

index 5e2d0a1..b0d7a9b 100644 (file)
@@ -4745,11 +4745,17 @@ subvert Perl's population of %ENV for nefarious purposes.
 =item Unknown switch condition (?(%s in regex; marked by <-- HERE in m/%s/
 
 (F) The condition part of a (?(condition)if-clause|else-clause) construct
-is not known. The condition may be lookahead or lookbehind (the condition
-is true if the lookahead or lookbehind is true), a (?{...})  construct (the
-condition is true if the code evaluates to a true value), or a number (the
-condition is true if the set of capturing parentheses named by the number
-matched).
+is not known. The condition must be one of the following:
+
+  (1) (2) ...        true if 1st, 2nd, etc., capture matched
+  (<NAME>) ('NAME')  true if named capture matched
+  (?=...) (?<=...)   true if subpattern matches
+  (?!...) (?<!...)   true if subpattern fails to match
+  (?{ CODE })        true if code returns a true value
+  (R)                true if evaluating inside recursion
+  (R1) (R2) ...      true if directly inside capture group 1, 2, etc.
+  (R&NAME)           true if directly inside named capture
+  (DEFINE)           always false; for defining named subpatterns
 
 The <-- HERE shows in the regular expression about where the problem was
 discovered.  See L<perlre>.