line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Exporter::NoWork; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1331
|
use 5.006; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
51
|
|
4
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
52
|
|
5
|
1
|
|
|
1
|
|
17
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
36
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
96
|
|
8
|
1
|
|
|
1
|
|
1320
|
use Attribute::Handlers; |
|
1
|
|
|
|
|
8948
|
|
|
1
|
|
|
|
|
9
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
my %Config; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub import { |
15
|
44
|
|
|
44
|
|
100010
|
my $from = shift; |
16
|
44
|
|
|
|
|
172
|
my $to = caller; |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
91
|
no strict 'refs'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
31
|
|
19
|
1
|
|
|
1
|
|
6
|
no warnings 'uninitialized'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
3182
|
|
20
|
|
|
|
|
|
|
|
21
|
44
|
100
|
|
|
|
159
|
if ($from eq __PACKAGE__) { |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# ->isa fails on 5.6, don't know why |
24
|
0
|
|
|
|
|
0
|
my $doneISA = $] < 5.008 |
25
|
9
|
50
|
|
|
|
155
|
? grep $_ eq __PACKAGE__, @{"$to\::ISA"} |
26
|
|
|
|
|
|
|
: $to->isa(__PACKAGE__); |
27
|
|
|
|
|
|
|
|
28
|
9
|
100
|
|
|
|
76
|
push @{"$to\::ISA"}, __PACKAGE__ unless $doneISA; |
|
7
|
|
|
|
|
118
|
|
29
|
|
|
|
|
|
|
|
30
|
9
|
|
|
|
|
31
|
for (@_) { |
31
|
4
|
100
|
|
|
|
21
|
/^-MAGIC$/ and do { |
32
|
1
|
|
|
|
|
5
|
$Config{$to}{uc} = 'magic'; |
33
|
1
|
|
|
|
|
4
|
next; |
34
|
|
|
|
|
|
|
}; |
35
|
3
|
100
|
|
|
|
13
|
/^-CONSTS$/ and do { |
36
|
1
|
|
|
|
|
4
|
$Config{$to}{uc} = 'consts'; |
37
|
1
|
|
|
|
|
3
|
next; |
38
|
|
|
|
|
|
|
}; |
39
|
2
|
|
|
|
|
4
|
push @{$Config{$to}{default}}, $_; |
|
2
|
|
|
|
|
12
|
|
40
|
|
|
|
|
|
|
} |
41
|
9
|
|
|
|
|
101
|
return; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
35
|
100
|
|
|
|
156
|
unless ($Config{$from}{grovelled}) { |
45
|
9
|
|
|
|
|
18
|
for (keys %{"$from\::"}) { |
|
9
|
|
|
|
|
93
|
|
46
|
|
|
|
|
|
|
|
47
|
54
|
100
|
100
|
|
|
72
|
if (exists &{"$from\::$_"} |
|
54
|
|
100
|
|
|
530
|
|
|
|
|
66
|
|
|
|
|
|
|
|
100
|
|
|
|
|
48
|
|
|
|
|
|
|
and not /^(?:IMPORT|CONFIG)$/ |
49
|
|
|
|
|
|
|
and not /^_/ |
50
|
|
|
|
|
|
|
and not ($Config{$from}{uc} eq 'magic' and /^[[:upper:]]+$/) |
51
|
|
|
|
|
|
|
){ |
52
|
15
|
100
|
100
|
|
|
66
|
if ($Config{$from}{uc} eq 'consts' |
53
|
|
|
|
|
|
|
and /^[[:upper:]_\d]+$/ |
54
|
|
|
|
|
|
|
) { |
55
|
1
|
|
|
|
|
3
|
push @{$Config{$from}{default}}, $_; |
|
1
|
|
|
|
|
4
|
|
56
|
1
|
|
|
|
|
2
|
push @{$Config{$from}{consts}}, $_; |
|
1
|
|
|
|
|
4
|
|
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
15
|
|
|
|
|
23
|
push @{$Config{$from}{all}}, $_; |
|
15
|
|
|
|
|
58
|
|
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
} |
62
|
9
|
|
|
|
|
35
|
$Config{$from}{grovelled} = 1; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
35
|
100
|
|
|
|
93
|
@_ or @_ = @{$Config{$from}{default}}; |
|
5
|
|
|
|
|
16
|
|
66
|
|
|
|
|
|
|
|
67
|
35
|
100
|
|
|
|
342
|
$from->can('IMPORT') and @_ = $from->IMPORT(@_); |
68
|
|
|
|
|
|
|
|
69
|
35
|
|
|
|
|
65
|
my @todo; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
SUB: |
72
|
35
|
|
|
|
|
102
|
while (my $sub = shift) { |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
# we have to do it like this, as C doesn't work |
75
|
49
|
|
|
|
|
97
|
for ($sub) { |
76
|
49
|
100
|
|
|
|
160
|
/^import$/i | /^CONFIG$/ and do { |
77
|
1
|
|
|
|
|
206
|
croak "Import methods can't be imported"; |
78
|
0
|
|
|
|
|
0
|
next SUB; |
79
|
|
|
|
|
|
|
}; |
80
|
|
|
|
|
|
|
|
81
|
48
|
100
|
|
|
|
149
|
s/^:// and do { |
82
|
10
|
100
|
|
|
|
69
|
/^ALL$/ and do { |
83
|
2
|
|
|
|
|
5
|
push @_, @{$Config{$from}{all}}; |
|
2
|
|
|
|
|
11
|
|
84
|
2
|
|
|
|
|
11
|
next SUB; |
85
|
|
|
|
|
|
|
}; |
86
|
8
|
100
|
|
|
|
33
|
/^DEFAULT$/ and do { |
87
|
4
|
|
|
|
|
9
|
push @_, @{$Config{$from}{default}}; |
|
4
|
|
|
|
|
16
|
|
88
|
4
|
|
|
|
|
19
|
next SUB; |
89
|
|
|
|
|
|
|
}; |
90
|
4
|
100
|
|
|
|
20
|
/^CONSTS$/ and do { |
91
|
1
|
|
|
|
|
3
|
push @_, @{$Config{$from}{consts}}; |
|
1
|
|
|
|
|
6
|
|
92
|
1
|
|
|
|
|
5
|
next SUB; |
93
|
|
|
|
|
|
|
}; |
94
|
|
|
|
|
|
|
|
95
|
3
|
100
|
|
|
|
16
|
if ($Config{$from}{tags}{$_}) { |
96
|
2
|
|
|
|
|
6
|
push @todo, @{$Config{$from}{tags}{$_}}; |
|
2
|
|
|
|
|
7
|
|
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
else { |
99
|
1
|
|
|
|
|
134
|
croak qq{Tag ":$_" is not recognized by $from}; |
100
|
|
|
|
|
|
|
} |
101
|
2
|
|
|
|
|
9
|
next SUB; |
102
|
|
|
|
|
|
|
}; |
103
|
|
|
|
|
|
|
|
104
|
38
|
100
|
|
|
|
115
|
s/^-// and do { |
105
|
10
|
100
|
|
|
|
15
|
if (${"$from\::CONFIG"}{$_}) { |
|
10
|
100
|
|
|
|
76
|
|
106
|
4
|
|
|
|
|
9
|
${"$from\::CONFIG"}{$_}->($from, $_, \@_); |
|
4
|
|
|
|
|
18
|
|
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
elsif ($from->can('CONFIG')) { |
109
|
5
|
|
|
|
|
18
|
$from->CONFIG($_, \@_); |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
else { |
112
|
1
|
|
|
|
|
141
|
croak qq{Config option "-$_" is not recognized by $from}; |
113
|
|
|
|
|
|
|
} |
114
|
9
|
|
|
|
|
74
|
next SUB; |
115
|
|
|
|
|
|
|
}; |
116
|
|
|
|
|
|
|
|
117
|
28
|
|
|
|
|
41
|
s/^\&//; |
118
|
28
|
100
|
66
|
|
|
389
|
/\W/ || /^_/ and croak qq{"$_" is not exported by $from}; |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
{ |
121
|
1
|
|
|
1
|
|
14
|
no warnings 'uninitialized'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
609
|
|
|
27
|
|
|
|
|
47
|
|
122
|
27
|
100
|
100
|
|
|
364
|
/^[[:upper:]]+$/ and $Config{$from}{uc} eq 'magic' |
123
|
|
|
|
|
|
|
and croak qq{Magic methods can't be exported}; |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
|
127
|
26
|
100
|
|
|
|
38
|
if (exists &{"$from\::$sub"}) { |
|
26
|
|
|
|
|
170
|
|
128
|
|
|
|
|
|
|
#carp "copying \&$from\::$sub into $to"; |
129
|
25
|
|
|
|
|
32
|
*{"$to\::$sub"} = \&{"$from\::$sub"}; |
|
25
|
|
|
|
|
158
|
|
|
25
|
|
|
|
|
70
|
|
130
|
25
|
|
|
|
|
92
|
next SUB; |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
1
|
|
|
|
|
200
|
croak qq{"$sub" is not exported by $from}; |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
|
136
|
29
|
|
|
|
|
42
|
for (keys %{"$from\::"}) { |
|
29
|
|
|
|
|
137
|
|
137
|
264
|
|
|
|
|
1824
|
for my $ref (@todo) { |
138
|
48
|
100
|
|
|
|
45
|
defined &{"$from\::$_"} or next; |
|
48
|
|
|
|
|
312
|
|
139
|
|
|
|
|
|
|
#carp "ref-ifying \&$from\::$_"; |
140
|
12
|
100
|
|
|
|
15
|
if ($ref == \&{"$from\::$_"}) { |
|
12
|
|
|
|
|
54
|
|
141
|
4
|
|
|
|
|
6
|
*{"$to\::$_"} = $ref; |
|
4
|
|
|
|
|
28
|
|
142
|
|
|
|
|
|
|
} |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
} |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
sub Tag : ATTR(CODE,BEGIN) { |
148
|
2
|
|
|
2
|
0
|
1210
|
my ($pkg, undef, $ref, undef, $tag, undef) = @_; |
149
|
|
|
|
|
|
|
|
150
|
2
|
50
|
|
|
|
7
|
ref $tag or $tag = [$tag]; |
151
|
2
|
|
|
|
|
8
|
for (@$tag) { |
152
|
2
|
|
|
|
|
3
|
push @{$Config{$pkg}{tags}{$_}}, $ref; |
|
2
|
|
|
|
|
17
|
|
153
|
|
|
|
|
|
|
} |
154
|
1
|
|
|
1
|
|
8
|
} |
|
1
|
|
|
|
|
17
|
|
|
1
|
|
|
|
|
10
|
|
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
1; |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
__END__ |