Skip to content

Commit

Permalink
Localize to empty sub only if already set
Browse files Browse the repository at this point in the history
  • Loading branch information
xdg committed Jul 24, 2018
1 parent 881d3e5 commit fc75d73
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/Path/Tiny.pm
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,20 @@ sub THAW { return path( $_[2] ) }
my $HAS_UU; # has Unicode::UTF8; lazily populated

sub _check_UU {
local $SIG{__DIE__}; # prevent outer handler from being called
local $SIG{__DIE__} = sub { }
if $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__}; # prevent outer handler from being called
local $SIG{__DIE__} = sub { }
if $SIG{__DIE__}; # prevent outer handler from being called
!!eval {
require PerlIO::utf8_strict;
PerlIO::utf8_strict->VERSION(0.003);
Expand Down

0 comments on commit fc75d73

Please sign in to comment.