Daniel Staal wrote:
If you separate 'module' from 'distribution', then I'd make that a cleaner
yes.  One CPAN distro should contain all the modules needed for a basic
use of some functionality, which is often one module, but may be more.

I was groping for the word "distribution" -- thanks.  :-)


The 'die' is there because CPAN tester machines were loading broken
earlier versions of Dpchrist::ExtUtils::MakeMaker and failing.  Is there
a better way to specify a minimum version while loading a module?

Look at the meta.yml file specs, and the docs for PREREQ_PM in
ExtUtils::MakeMaker.  (Which lists the format for all the perquisite
options.)  This functionality is built in.

My wording was unclear.  I'll try to clarify.


I don't produce a meta.yml in my distributions. It's my understanding that the CPAN indexer does that for me after I upload a distribution tarball.


http://perldoc.perl.org/5.10.0/ExtUtils/MakeMaker.html

It's my understand that PREREQ_PM is for specifying external modules needed once the distribution has been installed and is put into operation.


As this mechanism is specified within Makefile.PL, I don't believe it can work for Makefile.PL itself. I guess what I'm really looking for is a mechanism for specifying prerequisites of Makefile.PL.


I've added Dpchrist::ExtUtils::MakeMaker to the PREREQ_PM arguments for
all the other modules.  Strictly speaking, Dpchrist::ExtUtils::MakeMaker
only affects the generated Makefile targets and rules for each module,
not the Perl functionality of those modules.  I'm pondering whether or
not I should have these prerequisite entries.

Sounds like they should be in build_requires, not requires.

That sounds like Module::Build stuff:

    http://perldoc.perl.org/5.10.0/Module/Build/Compat.html


I've been using ExtUtils::MakeMaker for years and it has met my simple single-module distribution needs. But as I attempt to extend the tool and use the extended tool for sets of distributions, the going is getting tough. I'm wondering if I should upgrade, and to what -- Module::Install, Module::Build, or Dist::Zilla?


I have the desire to use functions from dependent core modules in
prerequisite core modules. For example, I'd like to use Dpchrist::Is
functions in Dpchrist::ExtUtils::MakeMaker.  But, to do so would create
circular dependencies.  The only idea I have for a solution is to put
all the interdependent *.pm modules into one CPAN module.  Is there
another way?

Probably, but that sounds like a decent solution.  ;)

Thanks for the confirmation.


If I do put multiple *.pm files into one CPAN module, what is the proper
way to load the modules from external code and/or from within?

Depends on what you need to do.  You can 'use' or 'require' the
subordinate modules as needed in most cases.  Just look up the perldoc on
each to for when to use which.  ;)  I tend to use 'require's if the module
is optional, and 'use' if it isn't.

http://perldoc.perl.org/5.10.0/functions/use.html

http://perldoc.perl.org/5.10.0/functions/require.html


Okay.


David

Reply via email to