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 config‐
22 uration of Perl modules. By "configuration", we mean something akin to
23 "user preferences" or "local settings". This is a formalization and
24 abstraction of the systems that people like Andreas Koenig ("CPAN::Con‐
25 fig"), Jon Swartz ("HTML::Mason::Config"), Andy Wardley ("Tem‐
26 plate::Config"), and Larry Wall (perl's own Config.pm) have developed
27 independently.
28
29 The configuration system emplyed 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 "Foo::Config‐
32 Data") (I would have called it "Foo::Config", but that was taken by all
33 those other systems mentioned in the previous paragraph...). These
34 "...::ConfigData" modules contain the configuration data, as well as
35 publically accessible methods for querying and setting (yes, actually
36 re-writing) the configuration data. The "config_data" script (whose
37 docs you are currently reading) is merely a front-end for those meth‐
38 ods. If you wish, you may create alternate front-ends.
39
40 The two types of data that may be stored are called "config" values and
41 "feature" values. A "config" value may be any perl scalar, including
42 references to complex data structures. It must, however, be serializ‐
43 able using "Data::Dumper". A "feature" is a boolean (1 or 0) value.
44
46 This script functions as a basic getter/setter wrapper around the con‐
47 figuration of a single module. On the command line, specify which mod‐
48 ule's configuration you're interested in, and pass options to get or
49 set "config" or "feature" values. The following options are supported:
50
51 module
52 Specifies the name of the module to configure (required).
53
54 feature
55 When passed the name of a "feature", shows its value. The value
56 will be 1 if the feature is enabled, 0 if the feature is not
57 enabled, or empty if the feature is unknown. When no feature name
58 is supplied, the names and values of all known features will be
59 shown.
60
61 config
62 When passed the name of a "config" entry, shows its value. The
63 value will be displayed using "Data::Dumper" (or similar) as perl
64 code. When no config name is supplied, the names and values of all
65 known config entries will be shown.
66
67 set_feature
68 Sets the given "feature" to the given boolean value. Specify the
69 value as either 1 or 0.
70
71 set_config
72 Sets the given "config" entry to the given value.
73
74 eval
75 If the "--eval" option is used, the values in "set_config" will be
76 evaluated as perl code before being stored. This allows moderately
77 complicated data structures to be stored. For really complicated
78 structures, you probably shouldn't use this command-line interface,
79 just use the Perl API instead.
80
81 help
82 Prints a help message, including a few examples, and exits.
83
85 Ken Williams, kwilliams@cpan.org
86
88 Copyright (c) 1999, Ken Williams. All rights reserved.
89
90 This library is free software; you can redistribute it and/or modify it
91 under the same terms as Perl itself.
92
94 Module::Build(3), perl(1).
95
96
97
98perl v5.8.8 2007-04-02 CONFIG_DATA(1)