line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Config::Backend::INIREG; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
39268
|
use 5.006; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
38
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
34
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
4
|
use Config; |
|
1
|
|
|
|
|
13
|
|
|
1
|
|
|
|
|
412
|
|
7
|
|
|
|
|
|
|
our $VERSION='0.02'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
if ($Config{'osname'} eq "MSWin32") { |
10
|
|
|
|
|
|
|
require Config::Backend::Registry; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
else { |
13
|
|
|
|
|
|
|
require Config::Backend::INI; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub new { |
17
|
1
|
|
|
1
|
1
|
15
|
my $class=shift; |
18
|
1
|
|
|
|
|
3
|
my $appname=shift; |
19
|
1
|
|
|
|
|
1
|
my $self; |
20
|
|
|
|
|
|
|
|
21
|
1
|
50
|
|
|
|
19
|
if ($Config{'osname'} eq "MSWin32") { |
22
|
0
|
|
|
|
|
0
|
$self->{"cfg"}=new Config::Backend::Registry($appname); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
else { |
25
|
1
|
|
|
|
|
3
|
my $home=$ENV{'HOME'}; |
26
|
1
|
50
|
|
|
|
4
|
if (not defined $home) { $home="."; } |
|
0
|
50
|
|
|
|
0
|
|
27
|
0
|
|
|
|
|
0
|
elsif ($home eq "") { $home="."; } |
28
|
1
|
|
|
|
|
11
|
$self->{"cfg"}=new Config::Backend::INI("$home/.$appname.ini"); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
|
|
1656
|
bless $self,$class; |
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
|
|
9
|
return $self; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub set { |
37
|
5
|
|
|
5
|
0
|
6237
|
my $self=shift; |
38
|
5
|
|
|
|
|
214
|
$self->{"cfg"}->set(@_); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub get { |
42
|
9
|
|
|
9
|
0
|
10773
|
my $self=shift; |
43
|
9
|
|
|
|
|
33
|
$self->{"cfg"}->get(@_); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub del { |
47
|
2
|
|
|
2
|
0
|
752
|
my $self=shift; |
48
|
2
|
|
|
|
|
9
|
$self->{"cfg"}->del(@_); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub variables { |
52
|
2
|
|
|
2
|
0
|
529
|
my $self=shift; |
53
|
2
|
|
|
|
|
10
|
$self->{"cfg"}->variables(@_); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
59
|
|
|
|
|
|
|
__END__ |