Created: 2010-04-01
To use Module::Build, first create a directory to hold the module. In that directory, create a subdirectory called "lib" and a file called Build.PL. If your module is to be called "MoJo::Joe", as inuse MoJo::Joe;create a subdirectory of "lib" called "MoJo", and in this directory create a file called "Joe.pm". "Joe.pm" needs to have the following contents:
package MoJo::Joe; 1;"Build.PL" needs to have the following contents:
use warnings; use strict; use Module::Build; my $build = Module::Build->new ( module_name => "MoJo::Joe", dist_version => "none", ); $build->create_build_script();
package MoJo::Joe; our $VERSION="0.01"; 1;Module::Build then extracts the version information from the module.
use warnings; use strict; use Module::Build; my $build = Module::Build->new ( module_name => "MoJo::Joe", ); $build->create_build_script();
package MoJo::Joe; use Hot::Spice; our $VERSION="0.01"; 1;you can specify that in your build script,
use warnings; use strict; use Module::Build; my $build = Module::Build->new ( module_name => "MoJo::Joe", requires => { Hot::Spice => 0, }, ); $build->create_build_script();Here the "0" means that no particular version of the "Hot::Spice" module is required.