line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Config::Merged; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
64274
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
84
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
83
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
require 5.006; |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
12
|
use base qw( Config::Any ); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
2055
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.05'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
2
|
1
|
6998
|
sub load_files { _merge( shift->SUPER::load_files( @_ ) ) } |
15
|
|
|
|
|
|
|
|
16
|
2
|
|
|
2
|
1
|
21375
|
sub load_stems { _merge( shift->SUPER::load_stems( @_ ) ) } |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub _merge { |
19
|
4
|
|
|
4
|
|
57723
|
my ( $mixed ) = @_; |
20
|
|
|
|
|
|
|
|
21
|
4
|
|
|
|
|
11
|
my ( $config, @configs ); |
22
|
|
|
|
|
|
|
|
23
|
4
|
100
|
|
|
|
26
|
if( ref $mixed eq 'ARRAY' ) { |
|
|
50
|
|
|
|
|
|
24
|
2
|
|
|
|
|
6
|
( $config, @configs ) = map { (%$_)[1] } @$mixed; |
|
4
|
|
|
|
|
18
|
|
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
elsif( ref $mixed eq 'HASH' ) { |
27
|
2
|
|
|
|
|
6
|
( $config, @configs ) = values %$mixed; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
else { |
30
|
0
|
|
|
|
|
0
|
die "Config::Any returned something unexpected. Please contact the author and report this as a bug\n"; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
_merge_hash( $config, $_ ) |
34
|
4
|
|
|
|
|
19
|
for @configs; |
35
|
|
|
|
|
|
|
|
36
|
4
|
|
|
|
|
17
|
return $config; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub _merge_hash { |
40
|
10
|
|
|
10
|
|
15
|
my ( $left, $right ) = @_; |
41
|
|
|
|
|
|
|
|
42
|
10
|
|
|
|
|
23
|
for my $key ( keys %$right ) { |
43
|
16
|
100
|
100
|
|
|
73
|
if( ref $right->{$key} eq 'HASH' && ref $left->{$key} eq 'HASH' ) { |
44
|
6
|
|
|
|
|
18
|
_merge_hash( $left->{$key}, $right->{$key} ); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
else { |
47
|
10
|
|
|
|
|
40
|
$left->{$key} = $right->{$key}; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1 |
54
|
|
|
|
|
|
|
__END__ |