line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Compare::Module; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
96167
|
use strict; |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
195
|
|
4
|
5
|
|
|
5
|
|
28
|
use warnings; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
135
|
|
5
|
5
|
|
|
5
|
|
140
|
use 5.008_005; |
|
5
|
|
|
|
|
18
|
|
|
5
|
|
|
|
|
285
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
7
|
|
|
|
|
|
|
|
8
|
5
|
|
|
5
|
|
7270
|
use List::Compare; |
|
5
|
|
|
|
|
139584
|
|
|
5
|
|
|
|
|
581
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub compare { |
11
|
10
|
|
|
10
|
0
|
49
|
my @args = @_; |
12
|
10
|
|
|
|
|
13
|
my $self; |
13
|
10
|
|
|
|
|
10
|
my ($module_a_name, $module_b_name); |
14
|
10
|
100
|
|
|
|
28
|
if (ref $args[0] eq 'Data::Compare::Module') { |
15
|
8
|
|
|
|
|
13
|
$self = shift @args; |
16
|
|
|
|
|
|
|
} |
17
|
10
|
|
|
|
|
16
|
($module_a_name, $module_b_name) = @args; |
18
|
10
|
100
|
66
|
|
|
41
|
if (!defined $module_a_name or !defined $module_b_name) { |
19
|
2
|
|
|
|
|
9
|
($module_a_name, $module_b_name) = ($self->{mod_a}, $self->{mod_b}); |
20
|
|
|
|
|
|
|
} |
21
|
5
|
|
|
5
|
|
602
|
no strict 'refs'; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
291
|
|
22
|
10
|
|
|
|
|
11
|
my $module_a_space = \%{$module_a_name . "::"}; |
|
10
|
|
|
|
|
30
|
|
23
|
10
|
|
|
|
|
14
|
my $module_b_space = \%{$module_b_name . "::"}; |
|
10
|
|
|
|
|
23
|
|
24
|
5
|
|
|
5
|
|
25
|
use strict 'refs'; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
1078
|
|
25
|
10
|
|
|
|
|
38
|
my @keys_a = keys %$module_a_space; |
26
|
10
|
|
|
|
|
36
|
my @keys_b = keys %$module_b_space; |
27
|
10
|
|
|
|
|
57
|
my $c = List::Compare->new(\@keys_a, \@keys_b); |
28
|
10
|
|
|
|
|
1449
|
my @only_a = $c->get_Lonly; |
29
|
10
|
|
|
|
|
145
|
my @only_b = $c->get_Ronly; |
30
|
|
|
|
|
|
|
|
31
|
10
|
|
|
|
|
260
|
return (\@only_a, \@only_b); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub new { |
35
|
9
|
|
|
9
|
0
|
4159
|
my $class = shift; |
36
|
9
|
|
|
|
|
23
|
my @args = @_; |
37
|
9
|
100
|
100
|
|
|
58
|
if (@args != 0 and @args != 2) { |
38
|
2
|
|
|
|
|
21
|
die "the constructor must receive 0 or 2 arguments"; |
39
|
|
|
|
|
|
|
} |
40
|
7
|
|
|
|
|
13
|
my $self = {}; |
41
|
7
|
100
|
|
|
|
24
|
if (@args == 2) { |
42
|
5
|
|
|
|
|
19
|
($self->{mod_a}, $self->{mod_b}) = @args; |
43
|
|
|
|
|
|
|
} |
44
|
7
|
|
|
|
|
30
|
bless $self, $class; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
__END__ |