As I do some work to my older modules, I'm converting their installation procedures to Module::Build (mentioned here).

Whilst updating CGI::Application::PhotoGallery, I ran in to a little bug (detailed by Phred). The desired behavior is to have the default templates install in @INC so i can simply add @INC to the include paths and they'll be used as a fall-back mechanism. The way I achieved that with ExtUtils::MakeMaker was to put them directly in the /lib/ directory in the distro and EU::MM will happily copy them over on make install.

With Module::Build, i can take them out of the lib directory and put them in /etc/ and use the pm_files option to make sure they're copied over:

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:

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.

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.

Just in case anyone stumbles across this older post ... it's possible that the issue has been fixed, but there's (currently) nothing to stop you from using a different build element whose files are also in lib, where MakeMaker would find them: