Library path question

Discussion in 'Perl' started by Julie Warden, Apr 21, 2006.

  1. Julie Warden

    Julie Warden Guest

    Group,

    I'm setting up Perl 5.8 on a Sun solaris 5.6 machine and have a question
    about the $PATH variable.

    My installation is in /usr/local with subdirs:
    perl is in bin
    libraries are in lib/perl5

    lib/perl5 has 4 subdirs and these have subdirs, and some of these have
    subdirs. In all I have about 1200 modules in more than 20 directories.

    Do I have to include all these directories in my path for perl to find
    them? Is there a $LIB var for perl like with C? Will perl parse dir trees
    for modules?

    If it isn't obvious, I have about 3 days experience with perl, so be
    gentle.

    Any help appreciated,
    Julie
     
    Julie Warden, Apr 21, 2006
    #1
    1. Advertising

  2. Well there is the $PERL5LIB variable which you can set in your
    environment, but Perl has its own internal library path which you can
    manipulate in your scripts: @INC. From your script you can add to this
    array by using the command: 'use lib '<path to modules>'

    You can see which paths it traverses by doing:

    perl -e 'join "\n", @INC'

    Hope this gets you going..

    -- Aukjan

    Julie Warden wrote:
    > Group,
    >
    > I'm setting up Perl 5.8 on a Sun solaris 5.6 machine and have a question
    > about the $PATH variable.
    >
    > My installation is in /usr/local with subdirs:
    > perl is in bin
    > libraries are in lib/perl5
    >
    > lib/perl5 has 4 subdirs and these have subdirs, and some of these have
    > subdirs. In all I have about 1200 modules in more than 20 directories.
    >
    > Do I have to include all these directories in my path for perl to find
    > them? Is there a $LIB var for perl like with C? Will perl parse dir trees
    > for modules?
    >
    > If it isn't obvious, I have about 3 days experience with perl, so be
    > gentle.
    >
    > Any help appreciated,
    > Julie
     
    Aukjan van Belkum, Apr 21, 2006
    #2
    1. Advertising

  3. Julie Warden

    Julie Warden Guest

    Aukjan van Belkum <> wrote in
    news:2cfac$4448e6d7$c2abfc64$:

    > Well there is the $PERL5LIB variable which you can set in your
    > environment, but Perl has its own internal library path which you can
    > manipulate in your scripts: @INC. From your script you can add to this
    > array by using the command: 'use lib '<path to modules>'
    >
    > You can see which paths it traverses by doing:
    >
    > perl -e 'join "\n", @INC'
    >
    > Hope this gets you going..
    >
    > -- Aukjan
    >
    > Julie Warden wrote:
    >> Group,
    >>
    >> I'm setting up Perl 5.8 on a Sun solaris 5.6 machine and have a
    >> question about the $PATH variable.
    >>
    >> My installation is in /usr/local with subdirs:
    >> perl is in bin
    >> libraries are in lib/perl5
    >>
    >> lib/perl5 has 4 subdirs and these have subdirs, and some of these
    >> have subdirs. In all I have about 1200 modules in more than 20
    >> directories.
    >>
    >> Do I have to include all these directories in my path for perl to
    >> find them? Is there a $LIB var for perl like with C? Will perl parse
    >> dir trees for modules?
    >>
    >> If it isn't obvious, I have about 3 days experience with perl, so be
    >> gentle.
    >>
    >> Any help appreciated,
    >> Julie


    Aukjan,

    Thanks! I also got some good info at the SunFreeWare site. This is a
    good tip, and I'm anxious to use it.

    Julie
     
    Julie Warden, Apr 21, 2006
    #3
    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. Keith-Earl
    Replies:
    1
    Views:
    1,979
    Peter O'Reilly
    May 3, 2004
  2. Replies:
    0
    Views:
    2,250
  3. Ron Adam
    Replies:
    3
    Views:
    450
    Ron Adam
    Aug 2, 2005
  4. Terracotta

    library.path VS class.path

    Terracotta, Jul 16, 2007, in forum: Java
    Replies:
    1
    Views:
    942
    Gordon Beaton
    Jul 16, 2007
  5. Terracotta

    library.path VS class.path

    Terracotta, Jul 16, 2007, in forum: Java
    Replies:
    0
    Views:
    470
    Terracotta
    Jul 16, 2007
Loading...

Share This Page