Cari di Perl 
    Perl User Manual
Daftar Isi
(Sebelumnya) Dump C structures as generated ...A commandline frontend to Modu ... (Berikutnya)
Utilities

Query or change configuration of Perl modules

Daftar Isi

NAME

config_data - Query or change configuration of Perl modules

SYNOPSIS

  1. # Get config/feature values
  2. config_data --module Foo::Bar --feature bazzable
  3. config_data --module Foo::Bar --config magic_number
  4. # Set config/feature values
  5. config_data --module Foo::Bar --set_feature bazzable=1
  6. config_data --module Foo::Bar --set_config magic_number=42
  7. # Print a usage message
  8. config_data --help

DESCRIPTION

The config_data tool provides a command-line interface to theconfiguration of Perl modules. By "configuration", we mean somethingakin to "user preferences" or "local settings". This is aformalization and abstraction of the systems that people like AndreasKoenig (CPAN::Config), Jon Swartz (HTML::Mason::Config), AndyWardley (Template::Config), and Larry Wall (perl's own Config.pm)have developed independently.

The configuration system emplyed here was developed in the context ofModule::Build. Under this system, configuration information for amodule Foo, for example, is stored in a module calledFoo::ConfigData) (I would have called it Foo::Config, but thatwas taken by all those other systems mentioned in the previousparagraph...). These ...::ConfigData modules contain theconfiguration data, as well as publically accessible methods forquerying and setting (yes, actually re-writing) the configurationdata. The config_data script (whose docs you are currentlyreading) is merely a front-end for those methods. If you wish, youmay create alternate front-ends.

The two types of data that may be stored are called config valuesand feature values. A config value may be any perl scalar,including references to complex data structures. It must, however, beserializable using Data::Dumper. A feature is a boolean (1 or0) value.

USAGE

This script functions as a basic getter/setter wrapper around theconfiguration of a single module. On the command line, specify whichmodule's configuration you're interested in, and pass options to getor set config or feature values. The following options aresupported:

  • module

    Specifies the name of the module to configure (required).

  • feature

    When passed the name of a feature, shows its value. The value willbe 1 if the feature is enabled, 0 if the feature is not enabled, orempty if the feature is unknown. When no feature name is supplied,the names and values of all known features will be shown.

  • config

    When passed the name of a config entry, shows its value. The valuewill be displayed using Data::Dumper (or similar) as perl code.When no config name is supplied, the names and values of all knownconfig entries will be shown.

  • set_feature

    Sets the given feature to the given boolean value. Specify the valueas either 1 or 0.

  • set_config

    Sets the given config entry to the given value.

  • eval

    If the --eval option is used, the values in set_config will beevaluated as perl code before being stored. This allows moderatelycomplicated data structures to be stored. For really complicatedstructures, you probably shouldn't use this command-line interface,just use the Perl API instead.

  • help

    Prints a help message, including a few examples, and exits.

AUTHOR

Ken Williams, [email protected]

COPYRIGHT

Copyright (c) 1999, Ken Williams. All rights reserved.

This library is free software; you can redistribute it and/or modifyit under the same terms as Perl itself.

SEE ALSO

Module::Build(3), perl(1).

 
Source : perldoc.perl.org - Official documentation for the Perl programming language
Site maintained by Jon Allen (JJ)     See the project page for more details
Documentation maintained by the Perl 5 Porters
(Sebelumnya) Dump C structures as generated ...A commandline frontend to Modu ... (Berikutnya)