http://qs321.pair.com?node_id=291927

mp has asked for the wisdom of the Perl Monks concerning the following question:

I'm starting to recompartmentalize code that is in 250+ library files (*.pm) into module distributions. The main motivation for doing this is to be able to integrate in unit tests so that modules can be tested standalone before installation.

(Is this a bad approach? Would it be better to just keep using the source module files (*.pm) directly without modulizing them, and just come up with some way to handle unit tests, rather than use the h2xs-generated framework?)

These module distributions use the same structure as CPAN modules (start with h2xs), but for the most part, they won't become CPAN modules because they are not general purpose. Previously, the mod_perl-driven website that used these modules used "use lib ..." to access the source for the libraries directly so there was no module build process, but in converting them to module distributions, they will each require building with:

perl Makefile.PL make make test make install

The modules will need to be installed on multiple servers. Their source code will undergo frequent modifications, so the modules will frequently need to be upgraded (re-installed) on multiple servers. The module sources will be kept in CVS.

With these not being CPAN modules, what is a good way to determine which version of each module is currently installed on a system? Also, what is a good way to handle the build process so that only those modules that have been modified are rebuilt? I can do a CVS update of the module sources on each system, but I need some way to determine which modules need to be re-built and re-installed. I have thought of making a global Makefile (or perl script that does basically the same thing a Makefile would do) to handle this, but am not sure if that's the best approach.

For CPAN modules, I can get pretty much what I need with Bundle files and the "autobundle" command in CPAN.pm, but I'm just not sure what is the best (and that requires the least amount of additional work) way to achieve similar capablity for non-CPAN modules. Is there some (relatively easy) way I can leverage off existing CPAN.pm functionality to treat these non-CPAN modules as though they were on CPAN?