Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Free Unix account that lets you install CPAN modules

by jmluceno (Initiate)
on Mar 28, 2012 at 14:58 UTC ( [id://962202]=perlquestion: print w/replies, xml ) Need Help??

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

I've run into a brick wall in my attempt to learn Perl. The free Unix system I practice on does not allow me to access the internet, so I cannot install modules locally using the CPAN module. I'd like to find a way around this so I can play around with modules that don't come with the standard library. I suspect the easiest thing would be to create a free account on a Unix system that allows me internet access. Can someone recommend one? I assume I'm not the only Perl novice who has encountered this problem. I've been trying for a few weeks to find a workaround but to no avail. Thanks in advance.
  • Comment on Free Unix account that lets you install CPAN modules

Replies are listed 'Best First'.
Re: Free Unix account that lets you install CPAN modules
by moritz (Cardinal) on Mar 28, 2012 at 15:02 UTC

    You can use CPAN::Mini to create a mirror of CPAN (but including only the newest version of each module, which reduces the size to something around 1GB). Of course that needs to be done on a machine that does have internet access (but you have access to such a machine, otherwise you couldn't ask on perlmonks :-).

    You can put that mirror on an USB stick, and configure the urllist of your CPAN client to use that mirror.

    I personally use such a setup even when I'm online, because it speeds up module installs significantly. Works pretty well.

Re: Free Unix account that lets you install CPAN modules
by dasgar (Priest) on Mar 28, 2012 at 16:28 UTC

    If you wanted to continue using your free Unix account, then doing something like what moritz suggested would probably be the best route to go.

    If you wanted to go a different route, here's a few suggestions about alternatives to using your free Unix account.

    • Perl isn't available only on *nix operating systems. You could try Perl on your home computer that has internet access.
    • I'm guessing that your home system is not running some kind of *nix OS and that you're wanting to learn Perl in an *nix environment. One alternative would be to use some kind of hypervisor (such as VirtualBox, which happens to be 100% free) and run a *nix based virtual machine on your home system. Then you would have your own *nix system to test with.
Re: Free Unix account that lets you install CPAN modules
by ikegami (Patriarch) on Mar 30, 2012 at 19:10 UTC
    Everything cpan does can be done manually without too much effort. It doesn't install modules at all; it simply downloads them and lets their Makefile.PL or Build.PL do the installing.
    tar xvzf foo.tar.gz cd foo

    then either

    perl Build.PL --install_base "$HOME" ./Build ./Build test ./Build install
    or
    perl Makefile.PL INSTALLBASE="$HOME" make make test make install

    Tell Perl how to locate the modules you install by stuffing the following in your login script:

    export PERL5LIB="$HOME/lib/perl5"

    There are two catches:

    • You'll have to satisfy dependencies. IIRC, Makefile.PL and Build.PL will tell you which dependencies aren't satisfied.
    • Dependencies on external (non-Perl) libraries will be hard to install. Normally, one would use the OS distribution's package system, but that's not available to you. If you want to install XML::LibXML (for example), you'll have figure out how to install libxml2 (the underlying C++ library) into your account if it's not already installed on the system.
Re: Free Unix account that lets you install CPAN modules
by Plankton (Vicar) on Mar 28, 2012 at 22:12 UTC
    Assuming you are using a window laptop like I do, I suggest installing VMPlayer from vmware and then setup a ubuntu VM on your window system. It should have the same internet access your window system has.
Re: Free Unix account that lets you install CPAN modules
by szabgab (Priest) on Mar 31, 2012 at 09:05 UTC

    Do you need to really use that (or any) Unix system? Most of what you can do with Perl is platform independent so you can use a Windows machine for that - if it is easier to put your hand on one.

    Try DWIM Perl for Windows which is a Strawberry Perl derivative that already contains a few hundred modules.

    (disclaimer: I am the packager of DWIM Perl)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-24 20:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found