From fa3d0b5e7c8ce7077e02b6062a7aee74f5159fbc Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Mon, 24 Apr 2017 08:50:55 +0200 Subject: Extend the examples --- README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'README.md') 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 -- cgit v1.1