9 my $code = eval_closure(
10 source => 'no strict "refs"; sub { keys %{__PACKAGE__ . "::"} }',
13 # defining the sub { } creates __ANON__, calling 'no strict' creates BEGIN
14 my @stash_keys = grep { $_ ne '__ANON__' && $_ ne 'BEGIN' } $code->();
16 is_deeply([@stash_keys], [], "compiled in an empty package");
20 # the more common case where you'd run into this is imported subs
21 # for instance, Bread::Board::as vs Moose::Util::TypeConstraints::as
22 my $c1 = eval_closure(
23 source => 'no strict "vars"; sub { ++$foo }',
25 my $c2 = eval_closure(
26 source => 'no strict "vars"; sub { --$foo }',