in reply to How to include a lot of files in a module?

Now, how do I include these files into the package?

What do you mean by "the package"? Do you mean that you want to have these files bundled up with your .pm files into a distribution so that if your module is installed somewhere, the files come along with it and your module can find them automatically?

If that's what you want, then you need to include instructions to that effect in your Makefile.PL or Build.PL so that those files are installed in your Perl library path. By default, only .pm and .pod files are actually installed. For example, here's a recipe from the Module::Build::Cookbook:

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

-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.