Perl's @INC - am I missing the point?

Discussion in 'Perl Misc' started by Andrew Fabbro, Apr 17, 2008.

  1. When building (compiling) perl, I wanted to include a directory where
    we install our local modules. So I built perl with -Dotherlibdirs=/app/
    common/oracle/perl/local.

    Later, I installed various modules with PREFIX=/app/common/oracle/perl/
    local

    However, perl can't find them (and yes, I checked and /app/common/
    oracle/perl/local is in @INC). However, if I put this in @INC:

    /app/common/oracle/perl/local/lib/site_perl/5.8.8/PA-RISC2.0-LP64

    Then it finds things and works just fine.

    But what the...heck is the point of -Dotherlibdirs if what you point
    it at doesn't work!? So should I rebuild perl with -Dotherlibdirs set
    to "/app/common/oracle/perl/local/lib/site_perl/5.8.8/PA-RISC2.0-
    LP64"? The whole point of this exercise was to avoid having to
    manually "use lib"...

    Or perhaps I'm just confused...
    Andrew Fabbro, Apr 17, 2008
    #1
    1. Advertising

  2. Andrew Fabbro

    Guest

    Andrew Fabbro <> wrote:
    > When building (compiling) perl, I wanted to include a directory where
    > we install our local modules. So I built perl with -Dotherlibdirs=/app/
    > common/oracle/perl/local.
    >
    > Later, I installed various modules with
    > PREFIX=/app/common/oracle/perl/local



    For some reason, PREFIX automatically gets /lib added to the end before it
    gets used for the location of installing the modules. I'm sure this makes
    complete sense to those people who understand this stuff, but I am not one
    of them.


    >
    > However, perl can't find them (and yes, I checked and /app/common/
    > oracle/perl/local is in @INC). However, if I put this in @INC:
    >
    > /app/common/oracle/perl/local/lib/site_perl/5.8.8/PA-RISC2.0-LP64
    >
    > Then it finds things and works just fine.


    It would probably work fine if you just put in
    /app/common/oracle/perl/local/lib


    >
    > But what the...heck is the point of -Dotherlibdirs if what you point
    > it at doesn't work!? So should I rebuild perl with -Dotherlibdirs set
    > to "/app/common/oracle/perl/local/lib/site_perl/5.8.8/PA-RISC2.0-
    > LP64"? The whole point of this exercise was to avoid having to
    > manually "use lib"...


    I think you should rebuild with -Dotherlibdirs set to
    /app/common/oracle/perl/local/lib

    >
    > Or perhaps I'm just confused...


    You and I both.

    Xho

    --
    -------------------- http://NewsReader.Com/ --------------------
    The costs of publication of this article were defrayed in part by the
    payment of page charges. This article must therefore be hereby marked
    advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
    this fact.
    , Apr 17, 2008
    #2
    1. Advertising

  3. On Apr 16, 9:55 pm, wrote:
    > It would probably work fine if you just put in
    > /app/common/oracle/perl/local/lib


    Alas...nope.
    Andrew Fabbro, Apr 17, 2008
    #3
  4. Andrew Fabbro

    Ben Morrow Guest

    Quoth Andrew Fabbro <>:
    > When building (compiling) perl, I wanted to include a directory where
    > we install our local modules. So I built perl with -Dotherlibdirs=/app/
    > common/oracle/perl/local.
    >
    > Later, I installed various modules with PREFIX=/app/common/oracle/perl/
    > local
    >
    > However, perl can't find them (and yes, I checked and /app/common/
    > oracle/perl/local is in @INC). However, if I put this in @INC:
    >
    > /app/common/oracle/perl/local/lib/site_perl/5.8.8/PA-RISC2.0-LP64
    >
    > Then it finds things and works just fine.


    You need to use LIB= for MakeMaker rather than PREFIX=. PREFIX is a
    little weird (for historical reasons); it means 'this is where my whole
    perl tree is installed', so it will attempt to create a whole lib/ man/
    bin/ tree matching the one your perl is installed into, including
    site_perl and so on.

    Ben
    Ben Morrow, Apr 17, 2008
    #4
  5. Andrew Fabbro

    Ben Morrow Guest

    Quoth Ben Morrow <>:
    >
    > Quoth Andrew Fabbro <>:
    > > When building (compiling) perl, I wanted to include a directory where
    > > we install our local modules. So I built perl with -Dotherlibdirs=/app/
    > > common/oracle/perl/local.
    > >
    > > Later, I installed various modules with PREFIX=/app/common/oracle/perl/
    > > local
    > >
    > > However, perl can't find them (and yes, I checked and /app/common/
    > > oracle/perl/local is in @INC). However, if I put this in @INC:
    > >
    > > /app/common/oracle/perl/local/lib/site_perl/5.8.8/PA-RISC2.0-LP64
    > >
    > > Then it finds things and works just fine.

    >
    > You need to use LIB= for MakeMaker rather than PREFIX=. PREFIX is a
    > little weird (for historical reasons); it means 'this is where my whole
    > perl tree is installed', so it will attempt to create a whole lib/ man/
    > bin/ tree matching the one your perl is installed into, including
    > site_perl and so on.


    Also, note that perl will only search arch-specific subdirs of
    otherlibdirs if they existed when Configure was run. So you need to make
    sure /app/common/oracle/perl/local/PA-RISC2.0-LP64 exists before you run
    Configure.

    Ben
    Ben Morrow, Apr 17, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Saraswati lakki
    Replies:
    0
    Views:
    1,273
    Saraswati lakki
    Jan 6, 2012
  2. Tony
    Replies:
    1
    Views:
    155
    Tony Curtis
    Aug 20, 2003
  3. Gary Hartl

    Perl can't locate a .pm in @INC

    Gary Hartl, Nov 4, 2003, in forum: Perl Misc
    Replies:
    7
    Views:
    155
    Gary Hartl
    Nov 5, 2003
  4. Horst Fickenscher

    Setting up initial @INC when configuring Perl 5.8.4

    Horst Fickenscher, Apr 27, 2004, in forum: Perl Misc
    Replies:
    0
    Views:
    95
    Horst Fickenscher
    Apr 27, 2004
  5. Replies:
    3
    Views:
    1,547
Loading...

Share This Page