The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

CPANPLUS::Configure - Configuration interface for CPAN++

SYNOPSIS

    use CPANPLUS::Configure;

    my $conf = new CPANPLUS::Configure;

    my @conf_options = $conf->subtypes('conf');

    $conf->load('options' => {'conf' => {'md5' => 1, 'flush' => 0}});

    my $_md5_setting = $conf->get_md5();
    $conf->set_debug(0);

    print $conf->dump();

    $conf->save();

DESCRIPTION

CPANPLUS::Configure can be used to view and manipulate configuration settings for CPANPLUS.

METHODS

new(conf => {CONFIGURATION})

The constructor will make a Config object. It will attempt to use a saved Config.pm if it exists. Arguments for 'conf' can be specified to replace those in the default Config for this object. The possible options are specified in set_conf().

If no Config.pm is found, or it is corrupt, you will be bumped to CPANPLUS::Configure::Setup to create one.

load(options => {OPTIONS})

Load is almost like the constructor, except that it takes a hash called 'options' which can contain keys such as 'conf'. Valid arguments which are passed will override Config settings.

save()

The save() function saves the Configure object to Config.pm, which is the default configuration for all CPANPLUS operations.

@subtypes = subtypes('conf')

This method will return a list of the subtypes of 'conf', which is the only public type. Every subtype in the array can be used as an argument in get_conf() and set_conf().

get_conf(SUBTYPE)

This function can be used to see the configuration setting of the named subtype.

Available subtypes are listed in set_conf().

set_conf(SUBTYPE => SETTING)

This method can be used to set any of the subtypes to new settings.

  • cpantest

    This is a boolean value; a true value enables prompting user to send test report to cpan-testers after each 'make test'.

  • debug

    This is a boolean value; a true value enables debugging mode and overrides verbosity settings.

  • flush

    This is a boolean value; a true value means that the cache will be automatically flushed.

  • force

    This is a boolean value. A true setting means that CPANPLUS will attempt to install modules even if they fail 'make test.' It will also force re-fetching of modules which have already been downloaded. Furthermore, force will install a module even if it is already up-to-date.

  • lib

    This is an array reference. It is analogous to 'use lib' for the paths specified. In scalar context, get_conf('lib') will return the first element in the array; in list context it will return the entire array.

  • makeflags

    This is a scalar value. The flags named in the string are added to the make command.

  • prereqs

    This argument relates to the treatment of prerequisite modules and has a value of 0, 1, 2 or 3. A 0 indicates that prerequisites are disallowed, a 1 enables automatic prerequisite installation, and a 2 prompts for each prerequisite.

    The setting of 3 indicates that the prerequisite will be tested but not installed. Their build directory will be added to the PERL5LIB environment variable so they will be in the path. This option is useful for building distributions.

  • storable

    This is a boolean value. A true setting allows the use of Storable.

  • verbose

    This is a boolean value. A true setting enables verbose mode.

  • md5

    This is a boolean value. A true setting enables md5 checks.

  • signature

    This is a boolean value. A true setting enables PGP signature checks.

  • makemakerflags

    This is a hash reference. Keys are flags to be added to the 'perl Makefile.PL' command and values are the settings the flags should be set to.

  • shell

    This is a scalar. It is the name of the default CPANPLUS shell.

AUTHORS

This module by Joshua Boschert <jambe@cpan.org>.

This pod text by Ann Barcomb <kudra@cpan.org>.

COPYRIGHT

The CPAN++ interface (of which this module is a part of) is copyright (c) 2001-2002 Jos Boumans <kane@cpan.org>. All rights reserved.

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

SEE ALSO

CPANPLUS::Configure::Setup