note
xdg
<p>Look at the [mod://Module::Build::Cookbook] on adding new file types to the build process. E.g. (from the cookbook)
</p>
<blockquote><i>
<p>
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:
</p>
<code>
use Module::Build;
my $build = new Module::Build
(
module_name => 'Boo::Baz',
...
);
$build->add_build_element('dat');
$build->create_build_script;
</code>
<p>
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.
</p>
</i></blockquote>
<p>There's more in the cookbook about what to do if you don't want to leave the files under <code>lib</code>, but keep them somewhere else instead.</p>
<blockquote><i>
<code>
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;
</code>
</i></blockquote>
<div class="pmsig"><div class="pmsig-268515">
<p>-xdg</p>
<p><small><i>Code written by xdg and posted on PerlMonks is <a href="http://creativecommons.org/licenses/publicdomain">public domain</a>. It is provided <b>as is</b> 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.</i></small></p>
</div></div>
493406
493406