| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package App::Rad::Config; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
sub load_config { |
|
4
|
2
|
|
|
2
|
0
|
4
|
my ($c, @files) = (@_); |
|
5
|
|
|
|
|
|
|
|
|
6
|
2
|
|
|
|
|
4
|
foreach my $filename (@files) { |
|
7
|
|
|
|
|
|
|
|
|
8
|
3
|
|
|
|
|
11
|
$c->debug("loading configuration from $filename"); |
|
9
|
3
|
50
|
|
|
|
129
|
open my $CONFIG, '<', $filename |
|
10
|
|
|
|
|
|
|
or Carp::croak "error opening $filename: $!\n"; |
|
11
|
|
|
|
|
|
|
|
|
12
|
3
|
|
|
|
|
36
|
while (<$CONFIG>) { |
|
13
|
36
|
|
|
|
|
45
|
chomp; |
|
14
|
36
|
|
|
|
|
53
|
s/#.*//; |
|
15
|
36
|
|
|
|
|
54
|
s/^\s+//; |
|
16
|
36
|
|
|
|
|
68
|
s/\s+$//; |
|
17
|
36
|
100
|
|
|
|
113
|
next unless length; |
|
18
|
|
|
|
|
|
|
|
|
19
|
17
|
50
|
|
|
|
75
|
if ( m/^([^\=\:\s]+) # key |
|
20
|
|
|
|
|
|
|
(?: # (value is optional) |
|
21
|
|
|
|
|
|
|
(?:\s*[\=\:]\s*|\s+) # separator ('=', ':' or whitespace) |
|
22
|
|
|
|
|
|
|
(.+) # value |
|
23
|
|
|
|
|
|
|
)? |
|
24
|
|
|
|
|
|
|
/x |
|
25
|
|
|
|
|
|
|
) { |
|
26
|
17
|
|
|
|
|
49
|
$c->config->{$1} = $2; |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
} |
|
29
|
3
|
|
|
|
|
39
|
close $CONFIG; |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
42; |