diff options
author | Patrick Spek <p.spek@tyil.nl> | 2017-07-29 02:24:10 +0200 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2017-07-29 02:24:10 +0200 |
commit | c59e97760ca21edd3b9c9a1b46dcb5a47f8274f7 (patch) | |
tree | 1d09df1980fe0cc2247e0622c7510efc58ce015d | |
parent | ad86672747b082aa0d61b882f9cc2cf9b10ab919 (diff) |
Update README
-rw-r--r-- | README.md | 33 |
1 files changed, 18 insertions, 15 deletions
@@ -21,33 +21,36 @@ please. ```perl6 use Config; -my $config = Config.new(); +my Config %config = Config.new(); -# load a simple configuration hash -$config.read({ +# Load a simple configuration hash +%config.read({ keyOne => "value", keyTwo => { NestedKey => "other value" } }); -# load a configuration files -$config.read("/etc/config.yaml"); +# Load a configuration files +%config.read("/etc/config.yaml"); -# load a configuration file with a specific parser -$config.read("/etc/config", "Config::Parser::ini"); +# Load a configuration file with a specific parser +%config.read("/etc/config", "Config::Parser::ini"); -# retrieve a simple key -$config.get("keyOne"); +# Retrieve a simple key +%config.get("keyOne"); -# retrieve a nested key -$config.get("keyTwo.NestedKey"); +# As of v1.2.0, `Config` support associative indexing: +%config<keyOne>; -# write out the configuration file -$config.write("/etc/config.yaml"); +# Retrieve a nested key +%config.get("keyTwo.NestedKey"); -# write out the configuration in another format -$config.write("/etc/config.json", "Config::Parser::json"); +# Write out the configuration file +%config.write("/etc/config.yaml"); + +# Write out the configuration in another format +%config.write("/etc/config.json", "Config::Parser::json"); ``` ### Available parsers |