blob: 5c3764f7f9a037a696658c88cfbd9df1b5bbcec7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use Eval::Closure;
my $code = eval_closure(
source => 'no strict "refs"; sub { keys %{__PACKAGE__ . "::"} }',
);
# defining the sub { } creates __ANON__, calling 'no strict' creates BEGIN
my @stash_keys = grep { $_ ne '__ANON__' && $_ ne 'BEGIN' } $code->();
is_deeply([@stash_keys], [], "compiled in an empty package");
done_testing;
|