1CONFIG_DATA(1) User Contributed Perl Documentation CONFIG_DATA(1)
2
3
4
6 config_data - Query or change configuration of Perl modules
7
9 # Get config/feature values
10 config_data --module Foo::Bar --feature bazzable
11 config_data --module Foo::Bar --config magic_number
12
13 # Set config/feature values
14 config_data --module Foo::Bar --set_feature bazzable=1
15 config_data --module Foo::Bar --set_config magic_number=42
16
17 # Print a usage message
18 config_data --help
19
21 The "config_data" tool provides a command-line interface to the
22 configuration of Perl modules. By "configuration", we mean something
23 akin to "user preferences" or "local settings". This is a
24 formalization and abstraction of the systems that people like Andreas
25 Koenig ("CPAN::Config"), Jon Swartz ("HTML::Mason::Config"), Andy
26 Wardley ("Template::Config"), and Larry Wall (perl's own Config.pm)
27 have developed independently.
28
29 The configuration system employed here was developed in the context of
30 "Module::Build". Under this system, configuration information for a
31 module "Foo", for example, is stored in a module called
32 "Foo::ConfigData") (I would have called it "Foo::Config", but that was
33 taken by all those other systems mentioned in the previous
34 paragraph...). These "...::ConfigData" modules contain the
35 configuration data, as well as publicly accessible methods for querying
36 and setting (yes, actually re-writing) the configuration data. The
37 "config_data" script (whose docs you are currently reading) is merely a
38 front-end for those methods. If you wish, you may create alternate
39 front-ends.
40
41 The two types of data that may be stored are called "config" values and
42 "feature" values. A "config" value may be any perl scalar, including
43 references to complex data structures. It must, however, be
44 serializable using "Data::Dumper". A "feature" is a boolean (1 or 0)
45 value.
46
48 This script functions as a basic getter/setter wrapper around the
49 configuration of a single module. On the command line, specify which
50 module's configuration you're interested in, and pass options to get or
51 set "config" or "feature" values. The following options are supported:
52
53 module
54 Specifies the name of the module to configure (required).
55
56 feature
57 When passed the name of a "feature", shows its value. The value
58 will be 1 if the feature is enabled, 0 if the feature is not
59 enabled, or empty if the feature is unknown. When no feature name
60 is supplied, the names and values of all known features will be
61 shown.
62
63 config
64 When passed the name of a "config" entry, shows its value. The
65 value will be displayed using "Data::Dumper" (or similar) as perl
66 code. When no config name is supplied, the names and values of all
67 known config entries will be shown.
68
69 set_feature
70 Sets the given "feature" to the given boolean value. Specify the
71 value as either 1 or 0.
72
73 set_config
74 Sets the given "config" entry to the given value.
75
76 eval
77 If the "--eval" option is used, the values in "set_config" will be
78 evaluated as perl code before being stored. This allows moderately
79 complicated data structures to be stored. For really complicated
80 structures, you probably shouldn't use this command-line interface,
81 just use the Perl API instead.
82
83 help
84 Prints a help message, including a few examples, and exits.
85
87 Ken Williams, kwilliams@cpan.org
88
90 Copyright (c) 1999, Ken Williams. All rights reserved.
91
92 This library is free software; you can redistribute it and/or modify it
93 under the same terms as Perl itself.
94
96 Module::Build(3), perl(1).
97
98
99
100perl v5.36.0 2023-01-20 CONFIG_DATA(1)