aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2017-04-24 08:50:55 +0200
committerPatrick Spek <p.spek@tyil.nl>2023-07-25 02:16:08 +0200
commitfa3d0b5e7c8ce7077e02b6062a7aee74f5159fbc (patch)
treed9426f8e3e1ae966d30c25269c9059ac3184c4fd /README.md
parent38aacfd77916173a5905cbb5af752f951e153013 (diff)
Extend the examples
Diffstat (limited to 'README.md')
-rw-r--r--README.md17
1 files changed, 13 insertions, 4 deletions
diff --git a/README.md b/README.md
index 6b9c52b..94daa4c 100644
--- a/README.md
+++ b/README.md
@@ -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