diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Config.pm6 | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Config.pm6 b/lib/Config.pm6 index 2369b6f..1d0d7db 100644 --- a/lib/Config.pm6 +++ b/lib/Config.pm6 @@ -160,11 +160,16 @@ class Config is export } #| Set a single key to a given value; - method set(Str $key, Any $value) + multi method set(Str $key, Any $value) + { + self.set($key.split("."), $value); + } + + multi method set(Array $keyparts, Any $value) { my $index := $!content; - for $key.split(".") -> $part { + for $keyparts -> $part { $index{$part} = {} unless defined($index{$part}); $index := $index{$part}; |