http://www.perlmonks.org?node_id=954682

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

After changing the cpan makepl_arg setting I tried downloading YAML again, as an experiment. Not to my total surprise, its appeared in a second location (consistent with the makepl_arg setting). So which YAML does perl use?
Can you or should you configure the library path manually? I ask this bec. neither of these locations correspond to where the bulk of the modules were installed, from the original installation*

YAML first installed, as expected, in:

/share/MD0_DATA/lib/perl5/site_/5.14.2/YAML

and after changing the makepl_org setting, YAML appeared in:

/share/MD0_DATA/.qpkg/Optware/lib/perl5/site_/5.14.2/YAML

*but modules from the original install are in:

/share/MD0_DATA/.qpkg/Optware/lib/perl5/5.14.2/

Thanks!

Replies are listed 'Best First'.
Re: duplicate modules any concern?
by Anonymous Monk on Feb 18, 2012 at 02:55 UTC

    So which YAML does perl use?

    The first one in @INC  perl -MYAML -le " print $INC{q/YAML.pm/} "

    Can you or should you configure the library path manually?

    Sure, if you want. perlrun#PERL5OPT

    perlrun#PERLLIB

Re: duplicate modules any concern?
by JavaFan (Canon) on Feb 18, 2012 at 10:58 UTC
    So which YAML does perl use?
    If you ask Perl nicely, it will tell you:
    perl -MYAML -E 'say $INC{"YAML.pm"} # Please'
      [~] # perl -MYAML -E 'say $INC{"YAML.pm"} # Please' /opt/lib/perl5/site_/5.14.2/YAML.pm # you're welcome!

      To be honest, I am confused about library path settings
      During perl install I was asked this question and entered config as shown below:

      1. Pathname where the private library files will reside? (~name ok) [/opt/lib/perl5/5.14.2]

      -->so is this the same as the cpan <mbuildpl_arg> setting...so if not already set, when using CPAN should I set:

      cpan> o conf makepl_arg "PREFIX=/opt"

      2. Another question during the perl install was:

      Pathname for the site-specific library files? (~name ok) [/opt/lib/perl5/site_/5.14.2]

      --> does this relate to any of the 'o conf' settings?

      3. Another question I have is...can you set such parameters as cpan's <cpan_home>, <build_dir>, <mbuildpl_arg> or <makepl_arg> during a tarball installation of perl?
      The problem is that I am installing it on a qnap NAS device in which /root is on a RAM drive with limited space. You can't accept the default settings. I was hoping to write the steps up on the qnap forum.

      4. A final question which arose from another posting here is, should I have set:

      cpan> o conf mbuildpl_arg "--install_base /opt"

      and how does this differ from

      cpan> o conf makepl_arg "PREFIX=/opt" )

      ?

      Thanks

        I do not know the answers to 1) and 2). For 3), the answer is no. Basically, for the same reason that you don't get to set your .exrc while compiling your Linux. Cpan is a tool, and it will allow configuration the first time it's run by a user. Different users get to pick different settings. For question 4), I'm unfamiliar with those settings, but judging from their spelling, one seems to be related to Build.pl, the other to Makefile.pl. But this is just a guess, assuming the author(s) picked sensible names.
Re: duplicate modules any concern?
by Don Coyote (Hermit) on Feb 18, 2012 at 08:42 UTC

    Just a brief thought on this.

    You can. Whether you should, depends on whom the module is going to be used by. If you are satisfied you are the only one going to use the module then there's no concerns over how you adapt your own system to suit your needs. But, should the module have a higher destiny, you may need to consider using more transparent methods such as compile time directives.