CPANPLUS::Dist::Build
my $build = CPANPLUS::Dist->new( format => 'build', module => $modobj, ); $build->create; # runs build && build test $build->install; # runs build install
CPANPLUS::Dist::Build is a distribution class for Module::Build related modules. Using this package, you can create, install and uninstall perl modules. It inherits from CPANPLUS::Dist.
Module::Build
CPANPLUS::Dist
Returns the CPANPLUS::Module object that parented this object.
CPANPLUS::Module
Returns the Object::Accessor object that keeps the status for this module.
Object::Accessor
All accessors can be accessed as follows: $build->status->ACCESSOR
Location of the Build file. Set to 0 explicitly if something went wrong.
BOOL indicating if the Build command was successful.
Build
BOOL indicating if the Build test command was successful.
Build test
BOOL indicating if the prepare call exited succesfully This gets set after perl Build.PL
prepare
perl Build.PL
Full path to the directory in which the prepare call took place, set after a call to prepare.
BOOL indicating if the create call exited succesfully. This gets set after Build and Build test.
create
BOOL indicating if the module was installed. This gets set after Build install exits successfully.
Build install
BOOL indicating if the module was uninstalled properly.
Storage of the arguments passed to create for this object. Used for recursive calls when satisfying prerequisites.
Storage of the arguments passed to install for this object. Used for recursive calls when satisfying prerequisites.
install
Storage of the Module::Build object we used for this installation.
Returns a boolean indicating whether or not you can use this package to create and install modules in your environment.
Sets up the CPANPLUS::Dist::Build object for use. Effectively creates all the needed status accessors.
Called automatically whenever you create a new CPANPLUS::Dist object.
create preps a distribution for installation. This means it will run perl Build.PL, Build and Build test. This will also satisfy any prerequisites the module may have.
If you set skiptest to true, it will skip the Build test stage. If you set force to true, it will go over all the stages of the Build process again, ignoring any previously cached results. It will also ignore a bad return value from Build test and still allow the operation to return true.
skiptest
force
Returns true on success and false on failure.
You may then call $dist->install on the object to actually install it. Returns true on success and false on failure.
$dist->install
Actually installs the created dist.
There are some known issues with Module::Build, that we hope the authors will resolve at some point, so we can make full use of Module::Build's power.
Uninstall modules installed by Module::Build
Module::Build doesn't write a so called packlist file, which holds a list of all files installed by a distribution. Without this file we don't know what to remove. Until Module::Build generates this packlist, we are unable to remove any installations done by it.
packlist
Module::Build's version comparison is not supported.
Module::Build has its own way of defining what versions are considered satisfactory for a prerequisite, and which ones aren't. This syntax is something specific to Module::Build and we currently have no way to see if a module on disk, on cpan or something similar is satisfactory according to Module::Build's version comparison scheme. As a work around, we now simply assume that the most recent version on CPAN satisfies a dependency.
Module::Build doesn't support 'PREFIX'
Module::Build doens't support the standard Makefile.PL argument PREFIX and dies if it is provided. Even though that's not usually a problem, sometimes M::B enabled distros ship a Makefile.PL that calls the Build.PL under the hood. In these cases, a PREFIX might be provided and Module::Build will die.
Makefile.PL
PREFIX
Build.PL
To install CPANPLUS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CPANPLUS
CPAN shell
perl -MCPAN -e shell install CPANPLUS
For more information on module installation, please visit the detailed CPAN module installation guide.