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

I think this is a very advanced question. I say that because based on the conversations I've had in the past (for instance in PM's cb), it seems that even those adept at building Perl from source do not retain detailed recollection of such minute knowledge any longer than they have to.

I'd like to know what the difference in function is between the Perl configuration setting otherlibdirs and the setting inc_version_list. The various files that are included in the Perl source kit (I am reading the files in kit for perl-5.8.1-RC4.tar.gz right now) discuss these configuration parameters at some length without ever really making clear how they differ or why there are two such things.

The Porting/Glossary file states WRT "inc_version_list":

 inc_version_list (inc_version_list.U): 

This variable specifies the list of subdirectories in over which perl.c:incpush() and lib/lib.pm will automatically search when adding directories to @INC. The elements in the list are separated by spaces. This is only useful if you have a perl library directory tree structured like the default one. See INSTALL for how this works. The versioned site_perl directory was introduced in 5.005, so that is the lowest possible value.
For "otherlibdirs" it says:
otherlibdirs (otherlibdirs.U): 

This variable contains a colon-separated set of paths for the perl binary to search for additional library files or modules. These directories will be tacked to the end of @INC. Perl will automatically search below each path for version- and architecture-specific directories. See inc_version_list for more details.

Now, to the uninformed Monk like myself, these plain-English explanations are not so plain. The latter refers to the former, strengthening the impression that these two settings do just the same thing. Is this some configuration cruft? or is there really some difference in how they behave?

Looking to INSTALL for greater enlightenment left me decidely unfufilled. The section headed

Coexistence with earlier versions of perl5

indeed discusses the issue but manages to avoid giving a single instance of an example of how the configurations shown were achieved. One part reads:
suppose you now install 5.8.0, which is not binary compatible with 5.6.0. The directories searched by 5.8.0 (if you don't change the Configure defaults) will be:


    /usr/local/lib/perl5/5.8.0/$archname
    /usr/local/lib/perl5/5.8.0
    /usr/local/lib/perl5/site_perl/5.8.0/$archname
    /usr/local/lib/perl5/site_perl/5.8.0

    /usr/local/lib/perl5/site_perl/5.6.0

    /usr/local/lib/perl5/site_perl/5.005

    /usr/local/lib/perl5/site_perl/     
Note that the earlier $archname entries are now gone, but pure perl modules from earlier versions will still be found.

This text is showing the results or effects of configure-time choices, not the choices themselves. I do grasp the principle being elucidated, I think. The point of the above section (should be read in toto for best understanding) is that recent Perls have built-in intelligence (read: heuristics) about architectural and BPI compatibility. So, if I grasp the material correctly (and Oh! Good Monks! I pray that you'll shed your illumination on me either way), one should only need to do a specification at Configure-time, of the top of the area in one's filesystem where there are Perl modules from earlier installations to be found. For instance, going by the above example, I'd want to do:

 -Dotherlibdirs=/usr/local/lib/site_perl 
somewhere on the command line (or equiv.) in order to achieve the above result. Or is it
 -Dinc_version_list=/usr/local/lib/site_perl 
or is it neither, or both, but done differently? For example, is inc_version_list intended to be done like
 -Dinc_version_list="5.8.0 5.6.1"  
as a way of mediating what versions Perl is allowed to consider when it looks at the top dir specified in otherlibdirs? If so, why would one ever need to do that?

Please provide me with informed insight concerning this holy mystery.

    Soren/Intrepid

-- 
"No matter what algorithm I try, I can't find the substring 'sh'
anywhere in the string 'CMD.EXE'!"

Replies are listed 'Best First'.
Re: Baffled by Perl Configure choices
by Abigail-II (Bishop) on Sep 05, 2003 at 10:53 UTC
    Now, to the uninformed Monk like myself, these plain-English explanations are not so plain. The latter refers to the former, strengthening the impression that these two settings do just the same thing. Is this some configuration cruft? or is there really some difference in how they behave?

    They are certainly not the same. The directories you give to otherlibdirs will be added to @INC, unconditionally. The directories you give to inc_version_list will be inspected to see if it contains one or more directory trees that could be a set of Perl modules. Directories found this way will be added to @INC.

    This text is showing the results or effects of configure-time choices, not the choices themselves.

    That's because it's the effect of not using configuration options. It does say (if you don't change the Configure defaults) after all.

    For more than 99.99% of the cases, there's no need to fiddle with with the options mentioned. Given a normal previous install, and the installation of the new version in the same place, Configure will do the right thing.

    Abigail

Re: Baffled by Perl Configure choices
by perrin (Chancellor) on Sep 05, 2003 at 16:32 UTC
    Is there a problem you're trying to solve here, or are you just curious about arcane Perl facts? Perl provides many ways to change @INC without recompiling.
Re: Baffled by Perl Configure choices
by Intrepid (Curate) on Sep 05, 2003 at 10:45 UTC

    Before anyone gets worried about it, with apologies for the brain-belch, my terminological confusion caused me to type ...

    recent Perls have built-in intelligence (read: heuristics) about architectural and BPI compatibility
    when I in fact meant ABI, of course.

        Soren/Intrepid

    -- 
    Try my n.y.p.m.blue Perl Monks CSS Theme
    (edit "On-Site CSS Markup" in your User Settings)