Config...otation(3pm)
π Config::Model::Annotation π
okay bestie, welcome to the Config...otation(3pm) page πΈ β yeah that title's giving "my man renderer ran out of room" energy, but it's really Config::Model::Annotation, straight out of the User Contributed Perl Documentation collection. grab a strawberry drink π and let's get into it.
β¨ NAME β¨
Config::Model::Annotation β Read and write configuration annotations π
that's the whole vibe. read 'em, write 'em, slay.
π VERSION π
version 2.166 β¨
π¦ SYNOPSIS π¦
here's what it looks like when you actually use it, no cap:
use Config::Model ;
# define configuration tree object
my $model = Config::Model->new ;
$model ->create_config_class (
name => "MyClass",
element => [
[qw/foo bar/] => {
type => 'leaf',
value_type => 'string'
},
baz => {
type => 'hash',
index_type => 'string' ,
cargo => {
type => 'leaf',
value_type => 'string',
},
},
],
) ;
my $inst = $model->instance(root_class_name => 'MyClass' );
my $root = $inst->config_root ;
# put some data in config tree the hard way
$root->fetch_element('foo')->store('yada') ;
$root->fetch_element('baz')->fetch_with_id('en')->store('hello') ;
# put annotation the hard way
$root->fetch_element('foo')->annotation('english') ;
$root->fetch_element('baz')->fetch_with_id('en')->annotation('also english') ;
# put more data the easy way
my $steps = 'baz:fr=bonjour#french baz:hr="dobar dan"#croatian';
$root->load( steps => $steps ) ;
# dump resulting tree with annotations
print $root->dump_tree;
# save annotations
my $annotate_saver = Config::Model::Annotation
-> new (
config_class_name => 'MyClass',
instance => $inst ,
root_dir => '/tmp/', # for test
) ;
$annotate_saver->save ;
# now check content of /tmp/config-model/MyClass-note.pl
bestie the synopsis comment says-note.pland the description below says-note.ymlπ I don't make the rules, I just report them. both appear exactly as written, fr fr.
π DESCRIPTION π
so this module hands you an object that reads and writes annotations β think of them as comments, but for your config tree π β back and forth to and from a configuration tree, and then it saves them into a file. not the configuration file, a whole separate file. and the reason it exists? it lets you stash annotations for configuration files that do not support comments at all. iconic workaround energy.
π¨ but listen: this module should not be used for configuration files that do support comments. if your file already does comments, go use those, okay? periodt.
where does your annotation file actually land? it depends on the effective id of the process (EUID, the real one, not your dreams):
/var/lib/config-model/<model_name>-note.ymlβ for root (EUID == 0) π~/.config-model/<model_name>-note.ymlβ for a normal user (EUID > 0) π§
π«Ά CONSTRUCTOR π«Ά
quite standard, ngl. you pass it a Config::Model::Instance object and it just... takes it. no drama, no surprises. π
π₯ METHODS π₯
save
Save annotations in a file (See DESCRIPTION) πΎ
load
Loads annotations from a file (See DESCRIPTION) π
π CAVEATS π
This module is currently not used. π
yeah. that's the whole caveat. it's giving "I'm in the codebase but not in the group chat" energy. π
π AUTHOR π
Dominique Dumont, (ddumont at cpan dot org) π
π SEE ALSO π
go check out the rest of the friend group, they're all iconic:
Config::ModelConfig::Model::NodeConfig::Model::LoaderConfig::Model::SearcherConfig::Model::Value
π AUTHOR π (yes, the sequel π )
Dominique Dumont
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2005-2022 by Dominique Dumont.
This is free software, licensed under:
The GNU Lesser General Public License, Version 2.1, February 1999
and that's the page, bestie π«Ά this was perl v5.42.3, dated 2026-07-23, and the manual name is Config...otation(3pm) in case you need to cite your sources. go annotate something and be the main character of your own config tree ππβ¨
π¦ where this page comes from
- ubuntu stonking: libconfig-model-perl 2.166-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