PATCH [perl #118563]: Fix perldata ident defn
authorKarl Williamson <public@khwilliamson.com>
Fri, 21 Jun 2013 18:04:32 +0000 (12:04 -0600)
committerKarl Williamson <public@khwilliamson.com>
Fri, 21 Jun 2013 18:16:30 +0000 (12:16 -0600)
The formal definition of identifiers was missing the fact that every
character in an identifier must match \w.  This also adds some
explanation.

pod/perldata.pod

index 8bf3dfd..e46507a 100644 (file)
@@ -120,7 +120,13 @@ restrictions.
 If working under the effect of the C<use utf8;> pragma, the following
 rules apply:
 
-    / (?[ ( \p{Word} & \p{XID_Start} ) + [_] ]) \p{XID_Continue}* /x
+    / (?[ ( \p{Word} & \p{XID_Start} ) + [_] ])
+      (?[ ( \p{Word} & \p{XID_Continue} ) ]) *    /x
+
+That is, a "start" character followed by any number of "continue"
+characters.  Perl requires every character in an identifier to also
+match C<\w> (this prevents some problematic cases); and Perl
+additionally accepts identfier names beginning with an underscore.
 
 If not under C<use utf8>, the source is treated as ASCII + 128 extra
 controls, and identifiers should match