line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
13
|
use v5.14; |
|
1
|
|
|
|
|
4
|
|
2
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings FATAL => 'all'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
50
|
|
4
|
1
|
|
|
1
|
|
5
|
no warnings qw(void once uninitialized numeric); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
75
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Moops::ImportSet; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
9
|
|
|
|
|
|
|
our $VERSION = '0.037'; |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
515
|
use Moo; |
|
1
|
|
|
|
|
8416
|
|
|
1
|
|
|
|
|
7
|
|
12
|
1
|
|
|
1
|
|
1653
|
use Module::Runtime qw(use_package_optimistically); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
13
|
1
|
|
|
1
|
|
495
|
use namespace::autoclean; |
|
1
|
|
|
|
|
17338
|
|
|
1
|
|
|
|
|
4
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has imports => (is => 'ro'); |
16
|
|
|
|
|
|
|
has ident => (is => 'ro', init_arg => undef, default => sub { state $x = 0; ++$x }); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our %SAVED; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub BUILD { |
21
|
1
|
|
|
1
|
0
|
8
|
my $self = shift; |
22
|
1
|
|
|
|
|
13
|
$SAVED{ $self->ident } = $self->imports; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub do_imports { |
26
|
1
|
|
|
1
|
0
|
187853
|
shift; |
27
|
1
|
|
|
|
|
5
|
my ($package, $ident) = @_; |
28
|
|
|
|
|
|
|
|
29
|
1
|
|
|
|
|
4
|
my $imports = $SAVED{$ident}; |
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
|
|
528
|
require Import::Into; |
32
|
1
|
|
|
|
|
650
|
for my $import (@$imports) |
33
|
|
|
|
|
|
|
{ |
34
|
1
|
|
|
|
|
5
|
my ($module, $params) = @$import; |
35
|
1
|
50
|
|
|
|
6
|
use_package_optimistically($module)->import::into( |
|
|
50
|
|
|
|
|
|
36
|
|
|
|
|
|
|
$package, |
37
|
|
|
|
|
|
|
(ref($params) eq q(HASH) ? %$params : ref($params) eq q(ARRAY) ? @$params : ()), |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub generate_code { |
43
|
1
|
|
|
1
|
0
|
3
|
my $self = shift; |
44
|
1
|
|
|
|
|
3
|
my ($pkg) = @_; |
45
|
1
|
|
|
|
|
3
|
my $class = ref $self; |
46
|
1
|
|
|
|
|
5
|
my $ident = $self->ident; |
47
|
1
|
|
|
|
|
7
|
return "BEGIN { '$class'->do_imports(q[$pkg], $ident) };"; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |