Today, a fresh module is released to work with .yaml configuration files. As usual, it is available to the public on github
Config :: YAML :: Modern ,
Config :: YAML :: Modern will be added to CPAN
a little later .
Why this module may be of interest to you? He does some cool tricks, for example:
- correctly smadzhit pack of .yaml files from the directory
- convert file.name.yaml file name to {File => {Name => {_content here_}}
- provides a dummy dive-style path-resolution qw / File Name inner_hash 0 my_key /
Areas of use? Offhand - the configuration of the project for collective work!
Interesting? Details under the cut.
So, YAML is the most convenient markup format for configuration files. It is at least man-readable and allows you to make comments (a
stone towards json ). It is platform independent (
platform = language used ). He's cool. Use YAML or die!
Persuaded? Moving on.
The most convenient form of the type of project configuration for collective work looks something like this
')
WTF !! ??
All right, everything is damn clear - there is main_config aka the main configuration of the project and two folders of developers in which the state of the main system is
different .
The first, meettya, seems to be doing something with another muscle.
Second, nic - screwed another pg server and does something with the system of sending messages to clients.
Diff is sexy! At any time, you can understand how your environment is different from the general config.
An example of how to use this beauty:
use Config::YAML::Modern; my $directory_main = '/etc/main_config/';
Everything! That's all you need to do in order to get a hash with the database parameters in $ db_mysql_config, well, what do you usually write there?
The given example is the simplest, the module has some more tasty buns in stock, which I clumsily tried to highlight in the documentation.
Use with pleasure and health!
Ps. Comments, wishes - send in patches on github! :)