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

Hi, I just downloaded the WWW:Mechanize module, but I have to use it on a school web server and I don't have the permissions to install it. Is there any way I can use it locally on my account without installing it in the main perl module directory? Thanks.

edited: Mon Apr 14 18:01:59 2003 by jeffa - title change (was: Stupid Noob question)

  • Comment on Install CPAN module without root perminssions

Replies are listed 'Best First'.
Re: Install CPAN module without root perminssions
by MrYoya (Monk) on Apr 14, 2003 at 17:59 UTC
    When running perl on the Makefile.PL, add prefix=/dir/to/install. So if you wanted to install to /home/guest, run

    perl Makefile.PL PREFIX=/home/guest

    Then either set the PERL5LIB environment variable before you run the script or say use lib '/home/guest';

      use lib '/home/guest';

      FYI, that never worked for me. When using PREFIX=/home/guest, I have to mention the explicit module base path (not the prefix used) in PERL5LIB or use lib qw(...). E.g.

      use lib '/home/guest/lib/site_perl/5.6.1';
        My thanks to everyone.
        Hopefully I will get it working.
        I have having similar problems. I have a sort of add-on question to post, though.

        I don't have permissions to the directory where perl is installed. I want to keep all of my modules I need in a separate directory. I can do a "perl Makefile.PL PREFIX=/to/my/dir", that's fine, but after I do a "perl make", and a "perl test", I try and do a "perl install". This tries to do something back in the original perl directory where I don't have permissions.

        Is it possible to "install" the modules in my own directory so that it doesn't ever "touch" the original perl directory? I thought that was what the PREFIX was for when I originally did a "perl Makefile.PL PREFIX...", is that wrong?
      Also, if you invoke your script with Perl directly, you could do:
      perl -I/home/guest myscript.pl