Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
CPAN Module without root

Posted by John_Moylan (John_Moylan), 19 August 2002
Now this has bothered me for a while.

In the past I have used the CPAN module to install other Perl modules, 'perl -MCPAN -eshell'.
I have root access to the machine so its not a problem
(if you've not heard of it give it a go, it will keep your hair black)  

However, on my own webspace I have only a user account, can I use the CPAN module to install without root access, perhaps to a local directory?

What I like about it is its ability to load all the dependencies thus making life easier, or will I have to do this all by hand and 'use lib ()' ?

jfp

Posted by admin (Graham Ellis), 20 August 2002
Good question, John.   The Install module needs some extra variables if you want to place things in non-standard places;  I have got the following from the reference material for running the CPAN modulke (-M CPAN) in an interactive mode,  but I suspect that if you set the things up as environment variables it might be useable in a batch mode too ...

from ... http://theoryx5.uwinnipeg.ca/CPAN/perl/CPAN.html

Quote:
I am not root, how can I install a module in a personal directory?

     You will most probably like something like this:

       o conf makepl_arg "LIB=~/myperl/lib \
                         INSTALLMAN1DIR=~/myperl/man/man1 \
                         INSTALLMAN3DIR=~/myperl/man/man3"
       install Sybase::Sybperl

     You can make this setting permanent like all o conf settings with o conf commit.


to use modules installed in private directories, you have a choice:
- setenv PERL5LIB /path/to/module
- use lib qw(/path/to/module)
- perl -l/path/to/module

All of these will append /path/to/module to @INC. You should keep in mind that having private/non-standard libraries may cause problems if you wish to have portable code.

Personal experience of this little corner very limited - please do post how you get on / whether the above helps



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2012: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho