line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
6332
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
42
|
|
2
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
88
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package ylib; |
5
|
|
|
|
|
|
|
# ABSTRACT: Add paths to @INC from a config file |
6
|
|
|
|
|
|
|
our $VERSION = '0.003'; # VERSION |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
3260
|
use File::HomeDir 0.86 (); |
|
1
|
|
|
|
|
10308
|
|
|
1
|
|
|
|
|
36
|
|
9
|
1
|
|
|
1
|
|
10
|
use Path::Tiny 0.052; |
|
1
|
|
|
|
|
19
|
|
|
1
|
|
|
|
|
252
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
require lib; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $name = '.mylib'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub import { |
16
|
6
|
|
|
6
|
|
21356
|
my $class = shift; |
17
|
6
|
|
|
|
|
49
|
my @configs = map { path( $_, $name ) } ( File::HomeDir->my_home(), '.' ); |
|
12
|
|
|
|
|
490
|
|
18
|
6
|
|
|
|
|
145
|
for my $f (@configs) { |
19
|
12
|
100
|
|
|
|
350
|
next unless -r $f; |
20
|
7
|
|
|
|
|
170
|
for my $dir ( $f->lines( { chomp => 1 } ) ) { |
21
|
10
|
100
|
|
|
|
1900
|
if ( -d $dir ) { |
22
|
9
|
|
|
|
|
60
|
lib->import("$dir"); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
else { |
25
|
1
|
|
|
|
|
10
|
warn "lib '$dir' was not found. skipping it\n"; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
6
|
|
|
|
|
760
|
return 1; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |