10 my $code = eval_closure(
11 source => 'sub { die "called\n" }',
13 ok($code, "got something");
15 like(exception { $code->() }, qr/^called$/, "got the right thing");
21 my $code = eval_closure(
22 source => 'sub { push @$bar, @_ }',
27 ok($code, "got something");
31 is_deeply($foo, [1], "got the right thing");
37 my $code = eval_closure(
38 # not sure if strict leaking into evals is intended, i think i remember
39 # it being changed in newer perls
40 source => 'do { no strict; sub { $foo } }',
43 ok($code, "got something");
45 ok(!$code->(), "environment is clean");