The first new feature we'll add to our address book is the ability to be configured from an outside configuration file. This will allow us to easily change configurable aspects of our application without having to touch any of the application code. This is helpful during development, but really shines when a non-programmer (like an end user or a system administrator) needs to change a minor setting when the application is in production.
This feature will also be the easiest to add. Catalyst is set to read configuration from a file by default, and it creates an example configuration file in the application's main directory. In our case, the file is called addressbook.conf
. This file is in the default configuration format and you can use other formats as mentioned in Chapter 2, Creating a Catalyst Application, if you choose to.
The simplest piece of configuration data you can add to your application is a single key-value pair (KVP). In YAML syntax, a configuration option...