9 sub DESTROY { $_[0]->() }
12 return bless(sub { $cleanup->() }, "End");
23 is($val, 1, "true return value from successful eval block");
24 is($err, "", "no exception after successful eval block");
34 is($val, undef, "undefined return value from eval block with 'die'");
35 is($err, "t3\n", "exception after eval block with 'die'");
43 is($val, 1, "true return value from successful eval block with localized \$@");
44 is($err, "", "no exception after successful eval block with localized \$@");
56 "undefined return value from eval block with 'die' and localized \$@");
58 "exception after eval block with 'die' and localized \$@");
63 my $c = end { $@ = "t2\n"; };
66 is($val, 1, "true return value from eval block with 'end'");
67 is($err, "", "no exception after eval block with 'end'");
72 my $c = end { $@ = "t2\n"; };
78 is($val, undef, "undefined return value from eval block with 'end' and 'die'");
79 is($err, "t3\n", "exception after eval block with 'end' and 'die'");