Uname:
Linux server.thebazaar99.com 5.14.0-687.17.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jun 22 07:21:26 EDT 2026 x86_64
Software:
Apache
PHP version:
8.3.32 [ PHP INFO ] PHP os:
Linux
Server Ip:
163.227.92.254
Your Ip:
216.73.217.24
User:
gutlooks (1003) | Group:
gutlooks (1005)
Safe Mode:
OFF
Disable Function:
exec,passthru,shell_exec,system
#!perl -w
BEGIN {
if( $ENV{PERL_CORE} ) {
chdir 't';
@INC = ('../lib', 'lib');
}
else {
unshift @INC, 't/lib';
}
}
use strict;
use Test::More 'no_plan';
require Test::Builder;
my $tb = Test::Builder->new;
# Test that _try() has no effect on $@ and $! and is not effected by
# __DIE__
{
local $SIG{__DIE__} = sub { fail("DIE handler called: @_") };
local $@ = 42;
local $! = 23;
is $tb->_try(sub { 2 }), 2;
is $tb->_try(sub { return '' }), '';
is $tb->_try(sub { die; }), undef;
is_deeply [$tb->_try(sub { die "Foo\n" })], [undef, "Foo\n"];
is $@, 42;
cmp_ok $!, '==', 23;
}
ok !eval {
$tb->_try(sub { die "Died\n" }, die_on_fail => 1);
};
is $@, "Died\n";