line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
113174
|
use strict qw; # no refs |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
69
|
|
2
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
119
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Exporter::WithBase; |
5
|
|
|
|
|
|
|
# ABSTRACT: Like Exporter, but add a '-base' flag to declare a class as a child |
6
|
|
|
|
|
|
|
$Exporter::WithBase::VERSION = '1.01'; |
7
|
2
|
|
|
2
|
|
15
|
use Exporter 5.57 (); |
|
2
|
|
|
|
|
65
|
|
|
2
|
|
|
|
|
327
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub import |
10
|
|
|
|
|
|
|
{ |
11
|
2
|
|
|
2
|
|
13
|
my $caller = caller; |
12
|
|
|
|
|
|
|
# If -base, inherit from Exporter |
13
|
2
|
50
|
33
|
|
|
10
|
if (@_ >= 2 && $_[1] eq '-base') { |
14
|
0
|
|
|
|
|
0
|
splice @_, 1, 1; |
15
|
0
|
0
|
|
|
|
0
|
push @{"${caller}::ISA"}, $_[0] eq __PACKAGE__ ? 'Exporter' : $_[0]; |
|
0
|
|
|
|
|
0
|
|
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
# Inject _import as import |
18
|
2
|
|
|
|
|
4
|
*{"${caller}::import"} = \&_import; |
|
2
|
|
|
|
|
84
|
|
19
|
|
|
|
|
|
|
# No symbols to export |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _import |
23
|
|
|
|
|
|
|
{ |
24
|
3
|
100
|
66
|
3
|
|
74
|
if (@_ >= 2 && $_[1] eq '-base') { |
25
|
1
|
|
|
|
|
5
|
splice @_, 1, 1; |
26
|
1
|
|
|
|
|
2
|
my $caller = caller; |
27
|
1
|
|
|
|
|
2
|
push @{"${caller}::ISA"}, $_[0]; |
|
1
|
|
|
|
|
9
|
|
28
|
|
|
|
|
|
|
} |
29
|
3
|
|
|
|
|
2622
|
goto &Exporter::import; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
__END__ |