| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Config::Files::Simple::YAML; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=encoding UTF-8 |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Config::Files::Simple::YAML - Yet another config file reader. |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 VERSION |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
version 0.01 |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=cut |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = '0.01'; # VERSION |
|
16
|
|
|
|
|
|
|
|
|
17
|
2
|
|
|
2
|
|
64819
|
use utf8; |
|
|
2
|
|
|
|
|
2
|
|
|
|
2
|
|
|
|
|
11
|
|
|
18
|
2
|
|
|
2
|
|
54
|
use strict; |
|
|
2
|
|
|
|
|
2
|
|
|
|
2
|
|
|
|
|
41
|
|
|
19
|
2
|
|
|
2
|
|
7
|
use warnings; |
|
|
2
|
|
|
|
|
1
|
|
|
|
2
|
|
|
|
|
309
|
|
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head2 new |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Constructor |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=cut |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub new { |
|
30
|
2
|
|
|
2
|
1
|
161
|
my $class = shift; |
|
31
|
2
|
|
|
|
|
4
|
my $self = {}; |
|
32
|
2
|
|
|
|
|
7
|
bless $self, $class; |
|
33
|
|
|
|
|
|
|
} |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head2 config_file |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Read configuration file from given path. |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub config_file { |
|
42
|
2
|
50
|
|
2
|
1
|
1089
|
if ( !-f $_[1] ) { |
|
43
|
0
|
|
|
|
|
0
|
require Carp; |
|
44
|
0
|
|
|
|
|
0
|
Carp::cluck "could not find $_[1] file"; |
|
45
|
0
|
|
|
|
|
0
|
return undef; |
|
46
|
|
|
|
|
|
|
} |
|
47
|
2
|
|
|
|
|
962
|
require String::Any::Extensions; |
|
48
|
2
|
50
|
|
|
|
778
|
if ( !String::Any::Extensions::include( $_[1], defined $_[2] ? $_[2] : [ '.yml', '.yaml' ] ) ) { |
|
|
|
50
|
|
|
|
|
|
|
49
|
2
|
|
|
|
|
72
|
require Carp; |
|
50
|
2
|
|
|
|
|
5
|
Carp::cluck("$_[1] seems not to be a YAML file."); |
|
51
|
|
|
|
|
|
|
} |
|
52
|
2
|
|
|
|
|
1394
|
require YAML; |
|
53
|
2
|
|
|
|
|
9415
|
return YAML::LoadFile( $_[1] ); |
|
54
|
|
|
|
|
|
|
} |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |