1Config::Model::DumpAsDaUtsae(r3)Contributed Perl DocumenCtoantfiiogn::Model::DumpAsData(3)
2
3
4
6 Config::Model::DumpAsData - Dump configuration content as a perl data
7 structure
8
10 version 1.205
11
13 use Config::Model ;
14
15 # create your config model
16 my $model = Config::Model -> new ;
17 $model->create_config_class( ... ) ;
18
19 # create instance
20 my $inst = $model->instance (root_class_name => 'FooBar',
21 instance_name => 'test1');
22
23 # create root of config
24 my $root = $inst -> config_root ;
25
26 my $data = $root->dump_as_data ;
27
29 This module is used directly by Config::Model::Node to dump the content
30 of a configuration tree in perl data structure.
31
32 The perl data structure is a hash of hash. Only CheckList content will
33 be stored in an array ref.
34
35 Note that undefined values are skipped for list element. I.e. if a list
36 element contains "('a',undef,'b')", the data structure will contain
37 'a','b'.
38
40 new ( )
41 No parameter. The constructor should be used only by
42 Config::Model::Node.
43
45 dump_as_data(...)
46 Return a perl data structure
47
48 Parameters are:
49
50 node
51 Reference to a Config::Model::Node object. Mandatory
52
53 full_dump
54 Also dump default values in the data structure. Useful if the
55 dumped configuration data will be used by the application. (default
56 is yes)
57
58 skip_auto_write
59 Skip node that have a "perl write" capabality in their model. See
60 Config::Model::AutoRead.
61
62 auto_vivify
63 Scan and create data for nodes elements even if no actual data was
64 stored in them. This may be useful to trap missing mandatory
65 values.
66
67 ordered_hash_as_list
68 By default, ordered hash (i.e. the order of the keys are important)
69 are dumped as Perl list. This is the faster way to dump such hashed
70 while keeping the key order. But it's the less readable way.
71
72 When this parmeter is 1 (default), the ordered hash is dumped as a
73 list:
74
75 [ A => 'foo', B => 'bar', C => 'baz' ]
76
77 When this parameter is set as 0, the ordered hash is dumped with a
78 special key that specifies the order of keys. E.g.:
79
80 { __order => [ 'A', 'B', 'C' ] ,
81 B => 'bar', A => 'foo', C => 'baz'
82 }
83
85 Dominique Dumont, (ddumont at cpan dot org)
86
88 Config::Model,Config::Model::Node,Config::Model::ObjTreeScanner
89
90
91
92perl v5.12.1 2010-08-18 Config::Model::DumpAsData(3)