http://www.perlmonks.org?node_id=493458


in reply to Module::Build's pm_files in ExtUtils::MakeMaker?

Look at the Module::Build::Cookbook on adding new file types to the build process. E.g. (from the cookbook)

Sometimes you might have extra types of files that you want to install alongside the standard types like .pm and .pod files. For instance, you might have a Foo.dat file containing some data related to the Boo::Baz module. Assuming the data doesn't need to be created on the fly, the best place for it to end up is probably as Boo/Baz/Foo.dat somewhere in perl's @INC path so Boo::Baz can access it easily at runtime. The following code from a sample Build.PL file demonstrates how to accomplish this:

use Module::Build; my $build = new Module::Build ( module_name => 'Boo::Baz', ... ); $build->add_build_element('dat'); $build->create_build_script;

This will find all .dat files in the lib/ directory, copy them to the blib/lib/ directory during the build action, and install them during the install action.

There's more in the cookbook about what to do if you don't want to leave the files under lib, but keep them somewhere else instead.

use Module::Build; my $build = new Module::Build ( module_name => 'Boo::Baz', dat_files => {'some/dir/Foo.dat' => 'lib/Boo/Baz/Foo.dat'}, ... ); $build->add_build_element('dat'); $build->create_build_script;

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.