install module without root access

Discussion in 'Perl Misc' started by Nicholas R. Markham, Jan 27, 2004.

  1. I'd like to install some modules on a machine on which I'm not root. I know
    about using PREFIX= with perl Makefile.pl, and that works fine for the first
    module. But if I want to install a module that depends on another module,
    which other module I've installed in, say, ~/perl, I get warnings of
    prerequisites not found. It seems that Makefile.pl doesn't know enough to
    look in the PREFIX directory for modules... Has anyone experienced this and
    solved it? Thanks.
     
    Nicholas R. Markham, Jan 27, 2004
    #1
    1. Advertising

  2. Nicholas R. Markham wrote:

    > It seems that Makefile.pl doesn't know enough to
    > look in the PREFIX directory for modules...


    You have to tell it what you want. Options for doing that are plentiful, but
    unfortunately ESP isn't (yet) one of them.

    If you're executing Makefile.PL manually, you can use the INC parameter.

    If you're using the CPAN shell to manage your modules, you can configure it
    to pass the appropriate INC parameter every time it runs Makefile.PL.

    You could add your module directory to the PERL5LIB environment variable.

    Note that the above aren't identical. You need to decide which is
    appropriate for what you want to do - add to the library path for a single
    invocation of Makefile.PL, for all such invocations via the CPAN shell, or
    for all scripts you run under your login.

    sherm--
     
    Sherm Pendley, Jan 27, 2004
    #2
    1. Advertising

  3. Gregory Toomey, Jan 28, 2004
    #3
  4. On Tue, 27 Jan 2004 16:56:35 -0500, Nicholas R. Markham wrote:

    > I'd like to install some modules on a machine on which I'm not root. I
    > know about using PREFIX= with perl Makefile.pl, and that works fine for
    > the first module. But if I want to install a module that depends on
    > another module, which other module I've installed in, say, ~/perl, I get
    > warnings of prerequisites not found. It seems that Makefile.pl doesn't
    > know enough to look in the PREFIX directory for modules... Has anyone
    > experienced this and solved it? Thanks.


    Set your PERL5LIB variable in your shell. I have used this method with
    zero problems on a Sun box at work - except in cases where core Perl
    modules need to be updated (like File::Spec). In that case, you have to
    visit your friendly admin and convince him to to upgrade Perl :)

    Also, you'll need to tell your scripts (if the PERL5LIB is not set in the
    shell) where your privately installed modules are. I usually use a BEGIN
    block to 'push' the needed directories into @INC.

    HTH

    --
    Jim

    Copyright notice: all code written by the author in this post is
    released under the GPL. http://www.gnu.org/licenses/gpl.txt
    for more information.

    a fortune quote ...
    You have junk mail.
     
    James Willmore, Jan 28, 2004
    #4
  5. Try setting the PERL5LIB to ~/perl before you start the
    make process. Example i tcsh:

    setenv PERL5LIB ~/perl

    If you have an internet connection I would recommend
    using CPAN directly (if you are installing CPAN modules):

    setenv PERL5LIB ~/perl # or ~/perl:${PERL5LIB}
    perl -MCPAN -e shell
    o conf makepl_arg LIB=~/perl # or PREFIX=~/lib
    <install as usual>

    I have done this for several users. Works like a charm.

    Regards,

    /Gunnar

    Nicholas R. Markham wrote:
    > I'd like to install some modules on a machine on which I'm not root. I know
    > about using PREFIX= with perl Makefile.pl, and that works fine for the first
    > module. But if I want to install a module that depends on another module,
    > which other module I've installed in, say, ~/perl, I get warnings of
    > prerequisites not found. It seems that Makefile.pl doesn't know enough to
    > look in the PREFIX directory for modules... Has anyone experienced this and
    > solved it? Thanks.
    >
    >
     
    Gunnar Strand, Jan 28, 2004
    #5
  6. "Sherm Pendley" <> wrote in message
    news:...
    > Nicholas R. Markham wrote:
    >
    > > It seems that Makefile.pl doesn't know enough to
    > > look in the PREFIX directory for modules...

    >
    > You have to tell it what you want. Options for doing that are plentiful,

    but
    > unfortunately ESP isn't (yet) one of them.
    >
    > If you're executing Makefile.PL manually, you can use the INC parameter.
    >
    > If you're using the CPAN shell to manage your modules, you can configure

    it
    > to pass the appropriate INC parameter every time it runs Makefile.PL.
    >
    > You could add your module directory to the PERL5LIB environment variable.
    >
    > Note that the above aren't identical. You need to decide which is
    > appropriate for what you want to do - add to the library path for a single
    > invocation of Makefile.PL, for all such invocations via the CPAN shell, or
    > for all scripts you run under your login.
    >
    > sherm--


    Ah, $PERL5LIB turned out to be what I was looking for. (At least until they
    get the ESP thing working - will that be in Perl 6?) Thanks.
     
    Nicholas R. Markham, Jan 28, 2004
    #6
    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. Replies:
    0
    Views:
    1,277
  2. Rick Osborn
    Replies:
    10
    Views:
    3,989
    Jon A. Cruz
    Feb 8, 2004
  3. hector
    Replies:
    5
    Views:
    433
    CBFalconer
    Dec 5, 2006
  4. Replies:
    13
    Views:
    308
    Paul Lalli
    Aug 20, 2006
  5. Replies:
    5
    Views:
    164
Loading...

Share This Page