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:
- New module author decides to use Module::Install for their new module
- Author downloads Module-Install tar ball and extracts contents
- Author runs "perl Makefile.PL" for Module-Install distribution
- Module::Install's Makefile.PL does "use lib 'lib'" then "use inc::Module::Install"
- perl finds lib/inc/Module/Install.pm that came with the Module-Install distribution
- 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
- Author writes new Makefile.PL for their own module
- Author runs "perl Makefile.PL" for the first time
- The new Makefile.PL runs "use inc::Module::Include"
- perl finds inc/Module/Install.pm among its standard modules
- inc/Module/Install.pm makes inc/Module sub-directory tree under the new module's build directory and copies itself into there
- 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
- Random user downloads and extract this new module then runs "perl Makefile.PL"
- The new module's Makefile.PL runs "use inc::Module::Install"
- If the random user has Module::Install installed, then perl will find inc/Module/Install.pm among the main modules
- 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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.