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

I'm working on a project (have been for over a year) which involves a base class, several modules which inherit from this base class to do specialized pieces, and one larger module which is also of this base class and uses the several other modules to include pieces.

My question is: how to I include all of these modules in one distribution (aside from distributing them separately and using the 'Bundle' method)?

I've noticed that when modules are included in subdirectories the MakeMaker will include them in the distribution, but I have not found any documentation on how this works to comfortably rely on it.

  • Comment on How to include multiple modules in one package?

Replies are listed 'Best First'.
Re: How to include multiple modules in one package?
by TheoPetersen (Priest) on Feb 17, 2001 at 23:12 UTC
    While I'm not sure it will make you comfortable, the documentation is in ExtUtils::MakeMaker. In practice I learn as much from examining other distributions as I have from reading the pod.

    You'll want all of the modules and module directories to be in one tree, with your Makefile.PL in the root of that tree. When you call WriteMakefile, use either the PM or PMLIBDIRS attributes to specify the modules.

      I've gotten it to work with subdirectories in the tree, and including the subdirectory files in the MANIFEST file.

      One thing that irks me: the tests for the subdirectories are run after the root directory. In my case, the subdirectories contain base classes which the root needs. How can I control the order of testing?

        I'm not sure I follow. Are these the automatic tests (test.pl && t/*.t)?

        If so, the usual trick is to name the files t/00test.t, t/01test.t and so on to get make to run them in the order you want.

Re: How to include multiple modules in one package?
by clintp (Curate) on Feb 18, 2001 at 01:21 UTC
    In "one distribution"? You mean a single file which contains your classes and the main parts of your program?

    An example of this is in my mail at the Perl Power Tools site. There's 3 or 4 classes in that one file, IIRC. They were all mashed together so that a single program could be distributed. Remember, a class is JUST a package namespace...

Re: How to include multiple modules in one package?
by coppit (Beadle) on Feb 18, 2001 at 11:16 UTC
    Yep. MakeMaker is a big pain to figure out. Check out my grepmail package--it distributes the Mail::Folder::Fastreader module in the .tar.gz file. Also see News Clipper. I have about 4 classes and 8 modules there.