<?xml version="1.0" encoding="windows-1252"?>
<node id="493406" title="Module::Build's pm_files in ExtUtils::MakeMaker?" created="2005-09-20 07:49:59" updated="2005-09-20 03:49:59">
<type id="115">
perlquestion</type>
<author id="168548">
LTjake</author>
<data>
<field name="doctext">
&lt;p&gt;&lt;em&gt;NB: This has been cross-posted to my [http://use.perl.org/~LTjake/journal/26773|journal]&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;As I do some work to my older modules, I'm converting their installation procedures to [cpan://Module::Build]&lt;/a&gt; (mentioned [http://use.perl.org/~LTjake/journal/23912|here]).&lt;/p&gt;
&lt;p&gt;Whilst updating [cpan://CGI::Application::PhotoGallery], I ran in to a little bug ([http://use.perl.org/comments.pl?sid=28535&amp;cid=43275|detailed by Phred]). The desired behavior is to have the default templates install in &lt;code&gt;@INC&lt;/code&gt; so i can simply add &lt;code&gt;@INC&lt;/code&gt; to the include paths and they'll be used as a fall-back mechanism. The way I achieved that with [cpan://ExtUtils::MakeMaker] was to put them directly in the &lt;code&gt;/lib/&lt;/code&gt; directory in the distro and EU::MM will happily copy them over on &lt;code&gt;make install&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;With Module::Build, i can take them out of the lib directory and put them in &lt;code&gt;/etc/&lt;/code&gt; and use the &lt;code&gt;pm_files&lt;/code&gt; option to make sure they're copied over:&lt;/p&gt;
&lt;code&gt;
pm_files           =&gt; {
	'etc/photos_index.tmpl'  =&gt; 'lib/CGI/Application/PhotoGallery/photos_index.tmpl',
	'etc/photos_single.tmpl' =&gt; 'lib/CGI/Application/PhotoGallery/photos_single.tmpl',

	# wish i could just do the templates...

	'lib/CGI/Application/PhotoGallery.pm'        =&gt; 'lib/CGI/Application/PhotoGallery.pm',
	'lib/CGI/Application/PhotoGallery/GD.pm'     =&gt; 'lib/CGI/Application/PhotoGallery/GD.pm',
	'lib/CGI/Application/PhotoGallery/Magick.pm' =&gt; 'lib/CGI/Application/PhotoGallery/Magick.pm'
}
&lt;/code&gt;
&lt;p&gt;This is fine and dandy, except that I'm auto-generating a Makefile.PL and Module::Build::Compat has no way to handle that construct.&lt;/p&gt;
&lt;p&gt;So, is there a better way to handle this scenario, or should i revert to stuffing my templates in the &lt;code&gt;/lib/&lt;/code&gt; directory?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Minor style updates.&lt;/p&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-168548"&gt;
&lt;p&gt;--&lt;br&gt;"&lt;i&gt;Go up to the next female stranger you see and tell her that her "body is a wonderland."&lt;br /&gt;
My hypothesis is that she’ll be too busy laughing at you to even bother slapping you.&lt;/i&gt;" ([http://www.somethingawful.com/articles.php?a=1854|src])&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</field>
</data>
</node>
