I have several CPAN modules that make extensive use of meta-programming to cut down on boiler-plate and to ease refactoring.
The consequence of this however is that there are many packages that get created programmatically, thus there is never a package X::Y::Z;
line in the source code for CPAN to find (and then use to add the namespace to your first-come list of reserved namespaces).
So my question is if there is a preferred way of letting CPAN know about these runtime created packages. Here are the options I am currently considering:
- Manually search down all of the packages and create a dummy
pm
file for CPAN to index. - Manually search and then update Build.PL to include them in the
provides
list. - Add some code to the meta-programming routines to keep track of which packages are used, and add a hook into to
build dist
to update theprovides
or some other section ofMETA.yaml
The last option is currently what I am leaning towards. I'd like to know if there are any problems with this approach, or any better ways of keeping CPAN updated with the complete list of packages.