The module in question is Config::Loader, which loads configuration directory trees.
It has a mechanism for merging local overrides into the main configuration tree, which currently consists of having a local.conf file at any point in the directory hierarchy. The values in local.conf are deep-merged with the main config tree at that point in the hierarchy.
At the request of a user, I'm adding the ability to customise the load and merge behaviour, adding three methods:
Used for skipping context specific config (eg don't load cron daemon config in the web server).
Does this file/dir contain local overrides? In which case it should be deep-merged instead of just loading it
What key should a given filename/dirname be converted to? For instance db-(dev.domain.com) should be loaded as the key db Alternatively, if load_as($local_override_file) returns '', then the deep merge is run on each key in the local file (like '../$_' foreach key %local).
What does this have to do with loading hundreds of lines of code? Well, these regexes do not need to be assembled hundreds of times during the process' lifetime, just at process startup.
Config::Loader just loads config - it doesn't have to be all singing and dancing. I'm adding the above flexibility, but I'd like to keep to core module as small as possible. I don't want to add dependencies which aren't strictly necessary. The developer who uses Config::Loader is free to choose to use Regexp::Assemble to create regexes, but I don't think it needs to be part of the core.
Clint
In reply to Re^4: Implementing filters as callbacks / hashrefs / regexes
by clinton
in thread Implementing filters as callbacks / hashrefs / regexes
by clinton
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |