summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/constant.pm
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-11-20 18:08:54 +0000
committerKarl Berry <karl@freefriends.org>2012-11-20 18:08:54 +0000
commitc5add2ea5067382269ae6f19e345fda0b9a7bd21 (patch)
tree02f512fda46d93079c9dc59c0d76f0e398150f83 /Master/tlpkg/tlperl/lib/constant.pm
parent6c35e87bdc5a3f64833dbbc42e7d42e683db9d5b (diff)
perl 5.16.2, compiled without optimization for Windows (from siep)
git-svn-id: svn://tug.org/texlive/trunk@28315 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/constant.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/constant.pm25
1 files changed, 20 insertions, 5 deletions
diff --git a/Master/tlpkg/tlperl/lib/constant.pm b/Master/tlpkg/tlperl/lib/constant.pm
index 22566ce28cf..ef618c43ab2 100644
--- a/Master/tlpkg/tlperl/lib/constant.pm
+++ b/Master/tlpkg/tlperl/lib/constant.pm
@@ -4,7 +4,7 @@ use strict;
use warnings::register;
use vars qw($VERSION %declared);
-$VERSION = '1.21';
+$VERSION = '1.23';
#=======================================================================
@@ -29,6 +29,19 @@ BEGIN {
no strict 'refs';
my $const = $] > 5.009002;
*_CAN_PCS = sub () {$const};
+
+ # Before this makes its way into a dev perl release, we have to do
+ # browser-sniffing, as it were....
+ return unless $const;
+ *{chr 256} = \3;
+ if (exists ${__PACKAGE__."::"}{"\xc4\x80"}) {
+ delete ${__PACKAGE__."::"}{"\xc4\x80"};
+ *_DOWNGRADE = sub () {1};
+ }
+ else {
+ delete ${__PACKAGE__."::"}{chr 256};
+ *_DOWNGRADE = sub () {0};
+ }
}
#=======================================================================
@@ -117,10 +130,12 @@ sub import {
if ($multiple || @_ == 1) {
my $scalar = $multiple ? $constants->{$name} : $_[0];
- # Work around perl bug #xxxxx: Sub names (actually glob
- # names in general) ignore the UTF8 flag. So we have to
- # turn it off to get the "right" symbol table entry.
- utf8::is_utf8 $name and utf8::encode $name;
+ if (_DOWNGRADE) { # for 5.10 to 5.14
+ # Work around perl bug #31991: Sub names (actually glob
+ # names in general) ignore the UTF8 flag. So we have to
+ # turn it off to get the "right" symbol table entry.
+ utf8::is_utf8 $name and utf8::encode $name;
+ }
# The constant serves to optimise this entire block out on
# 5.8 and earlier.