Config...:Itself(3pm)
π¦ NAME π¦
Config::Model::Itself β bestie, it's the Model (or schema) editor for Config::Model. That's the whole vibe. π
β VERSION β
version 2.027 β yeah she's been through some things and she's thriving π
β¨ SYNOPSIS β¨
# Itself constructor returns an object to read or write the data
# structure containing the model to be edited
my $meta_model = Config::Model::Itself -> new( ) ;
# now load the model to be edited
$meta_model -> read_all( ) ;
# For Curses UI prepare a call-back to write model
my $wr_back = sub { $meta_model->write_all(); }
# create Curses user interface
my $dialog = Config::Model::CursesUI-> new (
store => $wr_back,
) ;
# start Curses dialog to edit the mode
$dialog->start( $meta_model->config_root ) ;
# that's it. When user quits curses interface, Curses will call
# $wr_back sub ref to write the modified model.
Like, look at her go. Construct, read_all( ), hand the Curses UI a callback, boom β user edits the model itself, quits, and the callback writes it all back. No cap. π₯
π DESCRIPTION π
Okay so Config::Itself and its model files? They provide a model of Config:Model β which is literally why she's called Itself. She's modeling her own family. Main character energy fr fr. πͺ
Let's step back a little, bestie, because this is actually so good. Any configuration data is, in essence, structured data. And a configuration model is a way to describe the structure and relation of all items of a configuration data set.
Here's the iconic part: that configuration model is also expressed as structured data. And this structured data follows a set of rules which are described for humans in Config::Model.
The structure and rules documented in Config::Model are also expressed in a model in the files provided with Config::Model::Itself.
Hence the possibility to verify, modify configuration data provided by Config::Model can also be applied on configuration models. Using the same user interface. Same UI, different target β it's giving recursion but make it fashion. π
From a Perl point of view, Config::Model::Itself provides a class dedicated to read and write a set of model files.
πΈ Constructor πΈ
π new ( [ cm_lib_dir => ... ] ) π
Creates a new read/write handler. If no model_object is passed, the required objects are created for you (she's thoughtful like that π«Ά). cm_lib_dir specifies where the model files live β defaults to ./lib/Config/Model.
cm_lib_dir is either a Path::Tiny object or a string. Either one, she's not picky.
By default, this constructor will create all necessary Config::Model* objects. But if you already have some lying around and you're feeling generous, you can pass already-created objects with the options:
config_modelβ aConfig::Modelobjectmeta_instanceβ aConfig::Model::Instanceobjectmeta_rootβ aConfig::Model::Nodeobject
π§ Methods π§
read_all ( [ root_model => ... ], [ force_load => 1 ] )β Loads all the model files contained inmodel_dirand all its subdirectories.root_modelis used to filter the classes read. Useforce_loadif you are trying to load a model that contains errors (living dangerously, we love that for you π).read_allreturns a hash ref containing( class_name => file_name , ...).write_allβ Will write back the configuration model in the specified directory. The structure of the read directory is respected β she keeps the original layout, periodt. πwrite_model_plugin( plugin_dir => foo, plugin_name => bar )β Write plugin models in the passedplugin_dirdirectory (expected to be aPath::Tinyobject). The written file path is made of plugin name and class names. E.g. a plugin namedbarfor classFoo::Baris written inbar/Foo/Bar.plfile. This file is to be used byaugment_config_class '...', class_data )">read_model_plugin( plugin_dir => foo, plugin_name => bar.pl )β This method searches recursively$plugin_dir/$plugin_nameand loads all*.plfiles found there. Digging through the directories like a little treasure hunter πβ¨list_class_elementβ Returns a string listing all the class and elements. Useful for debugging your configuration model. Debugging bestie, we've all been there πget_dot_diagramβ Returns a graphviz dot file that represents the structure of the configuration model:includerelations are represented by solid lines- Class usage (i.e.
config_class_nameparameter) is represented by dashed lines. The name of the element is attached to the dashed line.
π BUGS π
Test menu entries are created from the content of the application model parameter. Unfortunately, there's no way to build the menu dynamically. So user cme must be restarted to change the menu if the application list is changed. Likeβ¦ you have to close the app and reopen it. It's giving 2005, but it is what it is. π
π CREDITS π
Here's the list of people who helped improve this project:
- Gregor Herrmann β Thanks for the patches ! π«Άβ¨
π SEE ALSO π
Config::Model, Config::Model::Node, Path::Tiny
Go read those, bestie, they're the lore. π
π AUTHOR π
Dominique Dumont β the icon, the legend π
βοΈ COPYRIGHT AND LICENSE βοΈ
This software is Copyright (c) 2007-2026 by Dominique Dumont.
This is free software, licensed under:
The GNU Lesser General Public License, Version 2.1, February 1999
π SUPPORT π
π Websites π
The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources. (Google it bestie, that's literally allowed π«Ά)
- CPANTS β The CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution.
<http://cpants.cpanauthors.org/dist/Config-Model-Itself>
- CPAN Testers β The CPAN Testers is a network of smoke testers who run automated tests on uploaded CPAN distributions.
<http://www.cpantesters.org/distro/C/Config-Model-Itself>
- CPAN Testers Matrix β The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms.
<http://matrix.cpantesters.org/?dist=Config-Model-Itself>
- CPAN Testers Dependencies β The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution.
<http://deps.cpantesters.org/?module=Config::Model::Itself>
π Bugs / Feature Requests π
Please report any bugs or feature requests by email to ddumont, or through the web interface at <https://github.com/dod38fr/config-model-itself/issues>. You will be automatically notified of any progress on the request by the system. Automatic updates? We love a system that texts you back. π
π» Source Code π»
The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository :) β yes bestie, contribute, you're literally built for this β¨
<http://github.com/dod38fr/config-model-itself>
git clone git://github.com/dod38fr/config-model-itself.git
and that's the whole page, babe β generated with perl v5.40.1, dated 2026-03-10, and yeah it's the Config...:Itself(3pm) manual, love her π
π¦ where this page comes from
- ubuntu resolute: libconfig-model-itself-perl 2.027-1 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms