diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Safe.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/Safe.pm | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/Master/tlpkg/tlperl/lib/Safe.pm b/Master/tlpkg/tlperl/lib/Safe.pm index 70549c5f4e8..a5cc238cba8 100644 --- a/Master/tlpkg/tlperl/lib/Safe.pm +++ b/Master/tlpkg/tlperl/lib/Safe.pm @@ -1,10 +1,9 @@ package Safe; use 5.003_11; -use strict; use Scalar::Util qw(reftype refaddr); -$Safe::VERSION = "2.29"; +$Safe::VERSION = "2.31_01"; # *** Don't declare any lexicals above this point *** # @@ -22,10 +21,11 @@ sub lexless_anon_sub { # Uses a closure (on $__ExPr__) to pass in the code to be executed. # (eval on one line to keep line numbers as expected by caller) eval sprintf - 'package %s; %s strict; sub { @_=(); eval q[my $__ExPr__;] . $__ExPr__; }', - $_[0], $_[1] ? 'use' : 'no'; + 'package %s; %s sub { @_=(); eval q[my $__ExPr__;] . $__ExPr__; }', + $_[0], $_[1] ? 'use strict;' : ''; } +use strict; use Carp; BEGIN { eval q{ use Carp::Heavy; @@ -61,12 +61,13 @@ use Opcode 1.01, qw( # Safe is loaded. Then we can add utf8::SWASHNEW to $default_share. require utf8; # we must ensure that utf8_heavy.pl, where SWASHNEW is defined, is loaded -# but without depending on knowledge of that implementation detail. -# This code (//i on a unicode string) ensures utf8 is fully loaded -# and also loads the ToFold SWASH. +# but without depending on too much knowledge of that implementation detail. +# This code (//i on a unicode string) should ensure utf8 is fully loaded +# and also loads the ToFold SWASH, unless things change so that these +# particular code points don't cause it to load. # (Swashes are cached internally by perl in PL_utf8_* variables # independent of being inside/outside of Safe. So once loaded they can be) -do { my $a = pack('U',0xC4); my $b = chr 0xE4; utf8::upgrade $b; $a =~ /$b/i }; +do { my $a = pack('U',0x100); my $b = chr 0x101; utf8::upgrade $b; $a =~ /$b/i }; # now we can safely include utf8::SWASHNEW in $default_share defined below. my $default_root = 0; @@ -102,15 +103,6 @@ my $default_share = [qw[ &re::regname &re::regnames &re::regnames_count - &Tie::Hash::NamedCapture::FETCH - &Tie::Hash::NamedCapture::STORE - &Tie::Hash::NamedCapture::DELETE - &Tie::Hash::NamedCapture::CLEAR - &Tie::Hash::NamedCapture::EXISTS - &Tie::Hash::NamedCapture::FIRSTKEY - &Tie::Hash::NamedCapture::NEXTKEY - &Tie::Hash::NamedCapture::SCALAR - &Tie::Hash::NamedCapture::flags &UNIVERSAL::DOES &version::() &version::new @@ -137,6 +129,16 @@ my $default_share = [qw[ &version::vxs::VCMP ]), ($] >= 5.011 && qw[ &re::regexp_pattern +]), ($] >= 5.010 && $] < 5.014 && qw[ + &Tie::Hash::NamedCapture::FETCH + &Tie::Hash::NamedCapture::STORE + &Tie::Hash::NamedCapture::DELETE + &Tie::Hash::NamedCapture::CLEAR + &Tie::Hash::NamedCapture::EXISTS + &Tie::Hash::NamedCapture::FIRSTKEY + &Tie::Hash::NamedCapture::NEXTKEY + &Tie::Hash::NamedCapture::SCALAR + &Tie::Hash::NamedCapture::flags ])]; sub new { |