Extensible library for reading and writing configuration files.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Patrick Spek 776d44a6fd
Bump to version 1.3.4
1 year ago
lib Remove redundant say statement 1 year ago
t Clean up tests from useless statements 1 year ago
.editorconfig Add editorconfig to the project 1 year ago
.gitignore Clear precomp files 2 years ago
.travis.yml Fix incorrect indentation in .travis.yml 1 year ago
CHANGELOG.md Bump to version 1.3.4 1 year ago
META6.json Bump to version 1.3.4 1 year ago
README.md Update README 1 year ago



A perl 6 library for reading and writing configuration files.

Build Status


This module can be installed using zef:

zef install Config

Depending on the type of configuration file you want to work on, you will need a Config::Parser:: module as well. If you just want an easy-to-use configuration object without reading/writing a file, no parser is needed.


Include the Config module in your script, instantiate it and use it as you please.

use Config;

my Config $config = Config.new();

# Load a simple configuration hash
    keyOne => "value",
    keyTwo => {
        NestedKey => "other value"

# Load a configuration files

# Load a configuration file with a specific parser
$config.read("/etc/config", "Config::Parser::ini");

# Retrieve a simple key

# As of v1.2.0, `Config` support associative indexing:

# Retrieve a nested key

# Write out the configuration file

# Write out the configuration in another format
$config.write("/etc/config.json", "Config::Parser::json");

Available parsers

Because there’s so many ways to structure your configuration files, the parsers for these are their own modules. This allows for easy implementing new parsers, or providing a custom parser for your project’s configuration file.

The parser will be loaded during runtime, but you have to make sure it is installed yourself.

The following parsers are available:

Writing your own parser

If you want to make your own parser, simply make a new class which extends the Config::Parser class, and implements the read and write methods. The read method must return a Hash. The write method must return a Bool, True when writing was successful, False if not. Throwing Exceptions to indicate the kind of failure is recommended.


This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.