diff options
author | Karl Williamson <khw@cpan.org> | 2014-04-24 08:35:08 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2014-05-30 10:02:07 -0600 |
commit | 2d8eb851e6c81f218af6e82b58807fcf79474b8f (patch) | |
tree | 80803c0976fe480d7f25ff828c868ae74401c5c0 /lib/_charnames.pm | |
parent | 36897d6498ecb95fe6bf65c28b19473476e54b34 (diff) | |
download | perl-2d8eb851e6c81f218af6e82b58807fcf79474b8f.tar.gz |
Fatalize deprecated \N{} definitions
Having a sequence of multiple spaces in a charnames alias name
definition or having trailing spaces in it have been deprecated since
5.18, and it is now time to make them fatal.
Diffstat (limited to 'lib/_charnames.pm')
-rw-r--r-- | lib/_charnames.pm | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/_charnames.pm b/lib/_charnames.pm index 4806b8fccf..4df3695cc2 100644 --- a/lib/_charnames.pm +++ b/lib/_charnames.pm @@ -185,19 +185,23 @@ sub alias (@) # Set up a single alias . "'"; } else { - $^H{charnames_name_aliases}{$name} = $value; - - if (warnings::enabled('deprecated')) { if ($name =~ / ( .* \s ) ( \s* ) $ /x) { - carp "Trailing white-space in a charnames alias definition is deprecated; marked by <-- HERE in '$1 <-- HERE " . $2 . "'"; + push @errors, "charnames alias definitions may not contain " + . "trailing white-space; marked by <-- HERE in " + . "'$1 <-- HERE " . $2 . "'"; + next; } # Use '+' instead of '*' in this regex, because any trailing - # blanks have already been warned about. + # blanks have already been found if ($name =~ / ( .*? \s{2} ) ( .+ ) /x) { - carp "A sequence of multiple spaces in a charnames alias definition is deprecated; marked by <-- HERE in '$1 <-- HERE " . $2 . "'"; + push @errors, "charnames alias definitions may not contain a " + . "sequence of multiple spaces; marked by <-- HERE " + . "in '$1 <-- HERE " . $2 . "'"; + next; } - } + + $^H{charnames_name_aliases}{$name} = $value; } } } |