diff options
author | Patrick Spek <p.spek@tyil.nl> | 2017-04-24 08:50:55 +0200 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2017-04-24 08:50:55 +0200 |
commit | ede6b8c4cfac8c5eed668ba8357f9e8b11ccbc43 (patch) | |
tree | d9426f8e3e1ae966d30c25269c9059ac3184c4fd | |
parent | 10c2bd55f7fcdae2235a2df1cd9373c23477f93c (diff) |
Extend the examples
-rw-r--r-- | README.md | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -23,7 +23,7 @@ use Config; my $config = Config.new(); -# loading a simple configuration hash +# load a simple configuration hash $config.read({ keyOne => "value", keyTwo => { @@ -31,14 +31,23 @@ $config.read({ } }); -# loading a configuration files +# load a configuration files $config.read("/etc/config.yaml"); -# retrieving a simple key +# load a configuration file with a specific parser +$config.read("/etc/config", "Config::Parser::ini"); + +# retrieve a simple key $config.get("keyOne"); -# retrieving a nested key +# retrieve a nested key $config.get("keyTwo.NestedKey"); + +# 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 |