Skip to content

Commit

Permalink
Preload Encode
Browse files Browse the repository at this point in the history
  • Loading branch information
xdg committed Jul 24, 2018
1 parent fc75d73 commit d7dac92
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/Path/Tiny.pm
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,22 @@ sub THAW { return path( $_[2] ) }
my $HAS_UU; # has Unicode::UTF8; lazily populated

sub _check_UU {
local $SIG{__DIE__} = sub { }
if $SIG{__DIE__}; # prevent outer handler from being called
local $SIG{__DIE__}; # prevent outer handler from being called
!!eval {
require Unicode::UTF8;
Unicode::UTF8->VERSION(0.58);
1;
};
}

my $HAS_PU; # has PerlIO::utf8_strict; lazily populated
my $HAS_PU; # has PerlIO::utf8_strict; lazily populated

sub _check_PU {
local $SIG{__DIE__} = sub { }
if $SIG{__DIE__}; # prevent outer handler from being called
local $SIG{__DIE__}; # prevent outer handler from being called
!!eval {
# MUST preload Encode or $SIG{__DIE__} localization fails
# on some Perl 5.8.8 (maybe other 5.8.*) compiled with -O2.
require Encode;
require PerlIO::utf8_strict;
PerlIO::utf8_strict->VERSION(0.003);
1;
Expand Down

0 comments on commit d7dac92

Please sign in to comment.