install module without root access

  • Thread starter Nicholas R. Markham
  • Start date
N

Nicholas R. Markham

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.
 
S

Sherm Pendley

Nicholas said:
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--
 
J

James Willmore

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.
 
G

Gunnar Strand

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
 
N

Nicholas R. Markham

Sherm Pendley said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top