… | |
… | |
60 | |
60 | |
61 | sub config { |
61 | sub config { |
62 | \%CFG |
62 | \%CFG |
63 | } |
63 | } |
64 | |
64 | |
65 | sub find_profile($) { |
65 | sub _find_profile($) { |
|
|
66 | my ($name) = @_; |
|
|
67 | |
|
|
68 | if (defined $name) { |
|
|
69 | my $profile = $CFG{profile}{$name}; |
|
|
70 | return _find_profile ($profile->{parent}), %$profile; |
|
|
71 | } else { |
|
|
72 | return %CFG; |
|
|
73 | } |
|
|
74 | } |
|
|
75 | |
|
|
76 | sub find_profile($;%) { |
|
|
77 | my ($name, %kv) = @_; |
|
|
78 | |
66 | +{ |
79 | +{ |
67 | %CFG, |
80 | %kv, |
68 | %{ $CFG{profile}{$_[0]} }, |
81 | _find_profile $name, |
69 | } |
82 | } |
70 | } |
83 | } |
71 | |
84 | |
72 | load; |
85 | load; |
73 | END { save } |
86 | END { save } |