From 9c1129c7de15ff8044f606550980c47f8c1724e9 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Fri, 21 Jun 2013 12:04:32 -0600 Subject: [PATCH] PATCH [perl #118563]: Fix perldata ident defn 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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pod/perldata.pod b/pod/perldata.pod index 8bf3dfd..e46507a 100644 --- a/pod/perldata.pod +++ b/pod/perldata.pod @@ -120,7 +120,13 @@ restrictions. If working under the effect of the C 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, the source is treated as ASCII + 128 extra controls, and identifiers should match -- 2.7.4