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

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?


Replies are listed 'Best First'.
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.


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\") 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

    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 MidLifeXis (Monsignor) 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.


Re: Installing a module without administrative privilege?
by frozenwithjoy (Priest) 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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://995443]
Approved by LanX
[ambrus]: No, you're not doing anything wrong. It's just that our automatic spam filters confuse you with the spammers who post advertisments for online shops of counterfeit branded clothing.
[ambrus]: Or unless you left the title field empty or entered a very short title for the node, but then you'd get a message saying that.
[ambrus]: I hope Corion or some other admin is here and can check the logs to see what the problem is.
[mz2255]: I wish I had an online shop but sadly no. The title field definitly wasn't short, had a perl module in the title with 5-6 additional words.
[ambrus]: you can also try to just post again in case it was some intermittent error

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (12)
As of 2017-10-19 15:34 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (255 votes). Check out past polls.