From bed0545e508167674dd785f4dbf098590963e261 Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Sat, 29 Jul 2017 02:24:10 +0200 Subject: Update README --- README.md | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 94daa4c..b92a9af 100644 --- a/README.md +++ b/README.md @@ -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; -# 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 -- cgit v1.1