in reply to Re: how could use inc::Module::Install ever work? and other M::I questions
in thread how could use inc::Module::Install ever work? and other M::I questions

It wasn't at all clear to me from the module documentation and it still wasn't completely clear from the responses. So, just to stress the points and clarify that they aren't contradicting...

Like I said, I couldn't find clarification reading the module documentation (Module::Install). But I looked at Makefile.PL to try to verify that inc/Module/Install.pm is supposed to get installed when you install Module::Install. I found this encouragement in a comment:

It causes inc::Module::Install to load from the (unique to this distribution) file ./lib/inc/Module/Install.pm instead of the system inc::Module::Install or the bundled /inc/Module/Install.pm

So, "use inc::Module::Install;" works when a new module author runs "perl Makefile.PL" because they installed Module::Install which installed inc/Module/Install.pm along with Module/Install.pm. And "use inc::Module::Install;" works when some random person downloads the new module because inc/Module/Install.pm gets included in the new module's tar ball (or other archive format).

To make it even clearer, there are the chronological steps:

  1. New module author decides to use Module::Install for their new module
  2. Author downloads Module-Install tar ball and extracts contents
  3. Author runs "perl Makefile.PL" for Module-Install distribution
  4. Module::Install's Makefile.PL does "use lib 'lib'" then "use inc::Module::Install"
  5. perl finds lib/inc/Module/Install.pm that came with the Module-Install distribution
  6. Author eventually runs "make install" which creates inc/Module sub-directory tree under some ...perl.../...lib... where, if the new author didn't make some mistake, perl is already searching for its standard modules and copies Install.pm into it
  7. Author writes new Makefile.PL for their own module
  8. Author runs "perl Makefile.PL" for the first time
  9. The new Makefile.PL runs "use inc::Module::Include"
  10. perl finds inc/Module/Install.pm among its standard modules
  11. inc/Module/Install.pm makes inc/Module sub-directory tree under the new module's build directory and copies itself into there
  12. Author makes a distribution and Module::Install has arranged the "manifest" file to list inc/Module/Install.pm so that it gets included in the tar ball and uploaded to PAUSE and CPAN
  13. Random user downloads and extract this new module then runs "perl Makefile.PL"
  14. The new module's Makefile.PL runs "use inc::Module::Install"
  15. If the random user has Module::Install installed, then perl will find inc/Module/Install.pm among the main modules
  16. If not, then perl will find the one included in the new module's distribution

That explanation should be more than sufficiently exhaustive. :)

So, it seems that metaperl didn't install Module::Install correctly.

- tye        

  • Comment on Re^2: how could use inc::Module::Install ever work? and other M::I questions (both!)