Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

rinceWind wrote (originally at 13:51 GMT +5 on 24 Sept 06):

Sadly, I find that EU::I is missing huge swathes of modules on my system. Diving into the code, I find that it only looks in two places: $config{archlibexp} and $config{sitearchexp}. Why oh why, I ask myself, just these special places? Surely the code should be traversing @INC. Heck, you could even have custom directories added via use lib or $ENV{PERL5LIB} that you want to be visible.

I've just looked at the code for ExtUtils::Installed and I have some answers. Not the asked-for solutions, but some answers. It's become de rigeur to bash ExtUtils:: generally (?). My opinion is: let's at least be correct when we do.

Why, I ask myself, just these special places? Surely the code should be traversing @INC. The code is traversing @INC in its search for the module names found via the mechanism I will describe shortly. See line 116 in the ExtUtils/Installed.pm shipped with perl-5.8.8 by ActiveState, for example (that's 0.08). Or refer to the code to follow my explanation if you don't have an editor or other Web tab open on the source already. See the new() subroutine specifically.

The new sub defines two vars as below:

my $archlib = $Config{archlibexp}; my $sitearch = $Config{sitearchexp};
and IMHO these two vars need to be joined by a third var, $Config{vendorarchexp}. That's a flaw in the module under almost any reasonable scope of expectations that I can conjure in my mind. However, it is not unreasonable that these two existing Config vars are used as they are, and this use is not limiting the scope of the search in exactly the manner explained by the OP. The reason for examining only FOOarchexp is that the values associated with each are the locations under which .packlist files are found.

The .packlist files (familiar to those of us who watch the actions of module installers (ExtUtils::MM, Module::Build) closely) were installed when each module was added to the Perl installation. ExtUtils::Installed is using the presence of these .packlist files as a means to the end of listing what modules have been installed.

Edit 25.09.06: correct next statement

It does not read the .packlist file in order to locate the module, you'll notice (because you are really reading the code by now, right? -- because it's more interesting than this long-winded explanation); ... the code simply takes note of the path to each (under .../auto/ ) and then creates a module name from that pathname. This is pretty reasonable behavior actually (in my analysis) in that it correlates well with how Perl's long-established mechanisms for how module management works.

    Soren A / somian / perlspinr / Intrepid

-- 
Words can be slippery, so consider who speaks as well as what is said; know as much as you can about the total context of the speaker's participation in a forum over time, before deciding that you fully comprehend the intention behind those words. If in doubt, ask for clarification before you 'flame'.

In reply to Re: ExtUtils::Installed doesn't list all modules by Intrepid
in thread ExtUtils::Installed doesn't list all modules by rinceWind

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-20 10:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found