Config...ellVar(3pm)
β¨ NAME β¨
Config::Model::Backend::ShellVar β bestie, this one reads and writes your config as a "SHELLVAR" data structure. π«Ά And yes, the manual you're reading rn is Config...ellVar(3pm) from the User Contributed Perl Documentation. Iconic.
π« VERSION π«
version 2.166
π SYNOPSIS π
okay so here's the whole vibe, take notes π
use Config::Model;
my $model = Config::Model->new;
$model->create_config_class (
name => "MyClass",
element => [
[qw/foo bar/] => {qw/type leaf value_type string/}
],
rw_config => {
backend => 'ShellVar',
config_dir => '/tmp',
file => 'foo.conf',
auto_create => 1,
}
);
my $inst = $model->instance(root_class_name => 'MyClass' );
my $root = $inst->config_root ;
$root->load('foo=FOO1 bar=BAR1' );
$inst->write_back ;
and then, the way that the file foo.conf now contains this?? literally:
## This file was written by Config::Model
## You may modify the content of this file. Configuration
## modifications will be preserved. Modifications in
## comments may be mangled.
##
foo="FOO1"
bar="BAR1"
ate. no crumbs. π
πΈ DESCRIPTION πΈ
So Config::Model uses this module directly to read or write the contents of a configuration tree written with "SHELLVAR" syntax in the "Config::Model" configuration tree. That's the whole job, and it does it gorgeously. β¨
β οΈ little heads-up bestie: undefined values get skipped for list elements. So if a list element holds('a',undef,'b'), the data structure ends up containing'a','b'β theundefjust ghosts you. π»
π¦ CONSTRUCTOR π¦
new
Parameters: ( node => $node_obj, name => 'shellvar' )
Inherited from Config::Model::Backend::Any. The constructor gets called by Config::Model::BackendMgr. It's giving inherited-and-thriving. π
read
Of all the parameters passed to this read call-back, only file_path is used.
When a file is read, read returns 1. periodt.
write
Of all the parameters passed to this write call-back, only file_path is used.
write returns 1. slay. π
π AUTHOR π
Dominique Dumont, (ddumont at cpan dot org)
π₯ SEE ALSO π₯
Config::Model, Config::Model::BackendMgr, Config::Model::Backend::Any,
π AUTHOR π
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 whole page, bestie π§ this was perl v5.42.3, dated 2026-07-23 β mwah, tysm for reading, go write some configs, ily πβ¨
π¦ 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