8 sub DESTROY { $_[0]->() }
11 return bless(sub { $cleanup->() }, "End");
22 is($val, 1, "true return value from successful eval block");
23 is($err, "", "no exception after successful eval block");
33 is($val, undef, "undefined return value from eval block with 'die'");
34 is($err, "t3\n", "exception after eval block with 'die'");
42 is($val, 1, "true return value from successful eval block with localized \$@");
43 is($err, "", "no exception after successful eval block with localized \$@");
55 "undefined return value from eval block with 'die' and localized \$@");
57 "exception after eval block with 'die' and localized \$@");
62 my $c = end { $@ = "t2\n"; };
65 is($val, 1, "true return value from eval block with 'end'");
66 is($err, "", "no exception after eval block with 'end'");
71 my $c = end { $@ = "t2\n"; };
77 is($val, undef, "undefined return value from eval block with 'end' and 'die'");
78 is($err, "t3\n", "exception after eval block with 'end' and 'die'");