1 package SL::LxOfficeConf;
9 read_config 'config/lx_office.conf.default' => %::lx_office_conf;
10 _decode_recursively(\%::lx_office_conf);
12 if (-f 'config/lx_office.conf') {
13 read_config 'config/lx_office.conf' => my %local_conf;
14 _decode_recursively(\%local_conf);
15 _flat_merge(\%::lx_office_conf, \%local_conf);
19 sub _decode_recursively {
22 while (my ($key, $value) = each %{ $obj }) {
23 if (ref($value) eq 'HASH') {
24 _decode_recursively($value);
26 $obj->{$key} = decode('UTF-8', $value);
34 while (my ($key, $value) = each %{ $src }) {
35 if (!exists $dst->{$key}) {
36 $dst->{$key} = $value;
39 map { $dst->{$key}->{$_} = $value->{$_} } keys %{ $value };