in reply to Development config files

This is my approach:

I have one config file that the app always reads, independently of the current run mode.

It's in JSON, but that's not really import - import is that you can have nested hashes. It looks like this, when written as Perl data structure:

my $conf = { app_home => '/path/to/app/', other_key => 'other_value', dev => { app_home => '/other/path', }, prod => { other_key => 'foo bar', }, };

Now when I ask my app for a config value, it first looks up in the sub hash of the same keys as the current run mode (dev, test, prod, staging, ...), and if it doesn't exist, it falls back to the same key at the top level hash.

(This is roughly the same as having a general config file, and separate config files for each runmode, but it saves you the pain of having separate paths for them).

I determine the run mode by environment variables, and for example the tests automatically set it test.