aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2017-07-29 02:24:10 +0200
committerPatrick Spek <p.spek@tyil.nl>2023-07-25 02:16:31 +0200
commitbed0545e508167674dd785f4dbf098590963e261 (patch)
tree1d09df1980fe0cc2247e0622c7510efc58ce015d /README.md
parent78b05339a0b4978a7d217a967a88c1d021af754a (diff)
Update README
Diffstat (limited to 'README.md')
-rw-r--r--README.md33
1 files changed, 18 insertions, 15 deletions
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<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