1Config::Model::Backend:U:sSehrelCloVnatrr(i3b)uted PerlCDooncfuimge:n:tMaotdieoln::Backend::ShellVar(3)
2
3
4

NAME

6       Config::Model::Backend::ShellVar - Read and write config as a
7       "SHELLVAR" data structure
8

VERSION

10       version 2.136
11

SYNOPSIS

13        use Config::Model;
14
15        my $model = Config::Model->new;
16        $model->create_config_class (
17           name    => "MyClass",
18           element => [
19               [qw/foo bar/] => {qw/type leaf value_type string/}
20           ],
21
22          rw_config  => {
23            backend => 'ShellVar',
24            config_dir => '/tmp',
25            file  => 'foo.conf',
26            auto_create => 1,
27          }
28        );
29
30        my $inst = $model->instance(root_class_name => 'MyClass' );
31        my $root = $inst->config_root ;
32
33        $root->load('foo=FOO1 bar=BAR1' );
34
35        $inst->write_back ;
36
37       File "foo.conf" now contains:
38
39        ## This file was written by Config::Model
40        ## You may modify the content of this file. Configuration
41        ## modifications will be preserved. Modifications in
42        ## comments may be mangled.
43        ##
44        foo="FOO1"
45
46        bar="BAR1"
47

DESCRIPTION

49       This module is used directly by Config::Model to read or write the
50       content of a configuration tree written with "SHELLVAR" syntax in
51       "Config::Model" configuration tree.
52
53       Note that undefined values are skipped for list element. I.e. if a list
54       element contains "('a',undef,'b')", the data structure contains
55       'a','b'.
56

CONSTRUCTOR

58   new
59       Parameters: "( node => $node_obj, name => 'shellvar' )"
60
61       Inherited from Config::Model::Backend::Any. The constructor is called
62       by Config::Model::BackendMgr.
63
64   read
65       Of all parameters passed to this read call-back, only "file_path" is
66       used.
67
68       When a file is read, "read" returns 1.
69
70   write
71       Of all parameters passed to this write call-back, only "file_path" is
72       used.
73
74       "write" returns 1.
75

AUTHOR

77       Dominique Dumont, (ddumont at cpan dot org)
78

SEE ALSO

80       Config::Model, Config::Model::BackendMgr, Config::Model::Backend::Any,
81

AUTHOR

83       Dominique Dumont
84
86       This software is Copyright (c) 2005-2019 by Dominique Dumont.
87
88       This is free software, licensed under:
89
90         The GNU Lesser General Public License, Version 2.1, February 1999
91
92
93
94perl v5.30.0                      2019-08-04Config::Model::Backend::ShellVar(3)
Impressum