diff options
author | Karl Williamson <khw@khw-desktop.(none)> | 2010-02-19 23:53:36 -0700 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2010-02-20 11:03:53 +0000 |
commit | cb233ae346c666d88ee890fc837f4cd3195c1f0b (patch) | |
tree | 0d414ca0a66af489c1d4764b5aec0f2061aa6b72 /pod/perldiag.pod | |
parent | c3c4140635dd08363a20c93a8c8b6d8e7464b891 (diff) | |
download | perl-cb233ae346c666d88ee890fc837f4cd3195c1f0b.tar.gz |
PATCH: deprecation warnings for unreasonable charnames
Prior to now just about anything has been legal for a character name in
\N{...}. This means that legal code was broken by having \N{3,4} for
example mean [^\n]{3,4}. Such code doesn't come from standard
charnames, but from legal custom translators.
This patch deprecates "unreasonable" names. handy.h is changed by the
addition of macros that taken together define the names we deem
reasonable, namely alpha beginning with alphanumerics and some
punctuations as continuations.
toke.c is changed to parse each name and to raise a warning if any
problematic characters are found.
Some tests and diagnostic documentation are also included.
Diffstat (limited to 'pod/perldiag.pod')
-rw-r--r-- | pod/perldiag.pod | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 95b45f761d..e1f02db742 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -1457,6 +1457,14 @@ there are neither package declarations nor a C<$VERSION>. long for Perl to handle. You have to be seriously twisted to write code that triggers this error. +=item Deprecated character(s) in \\N{...} starting at '%s' + +(D deprecated) Just about anything is legal for the C<...> in C<\N{...}>. +But starting in 5.12, non-reasonable ones that don't look like names are +deprecated. A reasonable name begins with an alphabetic character and +continues with any combination of alphanumerics, dashes, spaces, parentheses or +colons. + =item Deprecated use of my() in false conditional (D deprecated) You used a declaration similar to C<my $x if 0>. |