Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Installing a module without administrative privilege?

by Anonymous Monk
on Sep 24, 2012 at 21:53 UTC ( #995443=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks.

The college I attend finally installed perl on the campus wide network, but we are not allowed to install *any* software that accesses the registry of a campus machine. Since I would like to use one of the CPAN graphics modules for a course presentation, is there a way to download a module and store it in another directory? Each student has been granted a relatively small (10MB if I recall correctly) folder for keeping various documents, files, etc. Could I place a module there then use something like

use lib(...);


to use the module? If so, what, specifically, would I need to do in order for my program to see and use the module?

Thanks.

Comment on Installing a module without administrative privilege?
Download Code
Re: Installing a module without administrative privilege?
by tobyink (Abbot) on Sep 24, 2012 at 22:36 UTC

    Yes, you can. Exactly how easy it will be depends on which module. A pure Perl one should just be a matter of downloading the pm file, saving it with an appropriate name (e.g. for module Foo::Bar, use filename "C:\MyStuff\lib\Foo\Bar.pm") and then including the following at the top of your script:

    use lib 'c:/MyStuff/lib';

    Or run Perl with a command-line option telling it the location of your libraries.

    perl -Ic:\MyStuff\lib myscript.pl

    For XS modules that require compiling, it's more of a challenge, but assuming you have a compiler, ultimately possible.

    Of course, most modules have dependencies on other modules, so you'd need to make sure they are installed too.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
Re: Installing a module without administrative privilege?
by davido (Archbishop) on Sep 24, 2012 at 23:02 UTC

    Yet another problem solved by CPAN: local::lib.

    With it, you can set up your own local lib. By default, it would reside at ~/perl5/lib.


    Dave

Re: Installing a module without administrative privilege?
by frozenwithjoy (Curate) on Sep 24, 2012 at 23:29 UTC
    Prelbrew is my favorite way to gain complete control over the version of Perl and the selection of modules that I want to use w/o needing root/admin access.

    Edit: just noticed that you only have 10Mb available, so the other suggestions are a better fit for you. Good luck!

Re: Installing a module without administrative privilege?
by Anonymous Monk on Sep 25, 2012 at 01:53 UTC
    Also surf for discussions of "installing Perl as a non-root user," e.g. on a shared hosting setup. The good news is, Perl is used this way all the time.
Re: Installing a module without administrative privilege?
by MidLifeXis (Prior) on Sep 25, 2012 at 12:17 UTC

    Can you use a sneakernet virus vector thumb drive? You could use a portable perl installation on that drive (strawberry, dwimperl, activestate (IIRC) can all be configured or come by default as portable installs), along with your desired libraries, and make your presentation from there.

    One benefit from this setup is you are not limited to the 10MB limit, and you have the possibility of it still working even when (note that I didn't say if) the network fails in the middle of your presentation. This is assuming, of course, that you are able to use a thumb drive on those machines.

    --MidLifeXis

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://995443]
Approved by LanX
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2014-08-22 08:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (150 votes), past polls