diff options
Diffstat (limited to 'cpan/Test-Simple/lib/Test/Builder.pm')
-rw-r--r-- | cpan/Test-Simple/lib/Test/Builder.pm | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/cpan/Test-Simple/lib/Test/Builder.pm b/cpan/Test-Simple/lib/Test/Builder.pm index fbd2dbf181..b2ccd47a14 100644 --- a/cpan/Test-Simple/lib/Test/Builder.pm +++ b/cpan/Test-Simple/lib/Test/Builder.pm @@ -4,7 +4,7 @@ use 5.008001; use strict; use warnings; -our $VERSION = '1.301001_084'; +our $VERSION = '1.301001_087'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) @@ -867,13 +867,10 @@ sub _try { my $error; my $return; - { - local $!; # eval can mess up $! - local $@; # don't set $@ in the test - local $SIG{__DIE__}; # don't trip an outside DIE handler. + protect { $return = eval { $code->() }; $error = $@; - } + }; die $error if $error and $opts{die_on_fail}; @@ -1049,7 +1046,7 @@ Check if something is a filehandle =item $TB->level -Get/Set C<$Test::Builder::Level>. $Level is a package var, and most thigns +Get/Set C<$Test::Builder::Level>. $Level is a package var, and most things localize it, so this method is pretty useless. =item $TB->maybe_regex |