Skip to content

Quickstart Guide For Unix

schwern edited this page Mar 17, 2013 · 9 revisions

Unix includes things like Linux, Mac OS X, Ubuntu, BSD, Fedora, Redhat, etc...

Basically, if its not Windows, its Unix.

The tool we rely on to install Perl in your home directory and configure everything is perlbrew. Everything that happens here is happening in your home directory.

tl;dr version

Run these commands to install perlbrew, cpanm and perl5i.

curl -kL http://install.perlbrew.pl | bash
source ~/perl5/perlbrew/etc/bashrc
echo 'source ~/perl5/perlbrew/etc/bashrc' >> ~/.bash_profile
perlbrew install perl-5.16.3
perlbrew switch perl-5.16.3
perlbrew install-cpanm
cpanm perl5i
perl -e 'use perl5i::2; say "Hello perl5i!"'

The same thing, but explained

Install perlbrew

Follow the directions on the perlbrew home page. For most folks this should be:

curl -kL http://install.perlbrew.pl | bash

Then make sure its available for use.

source ~/perl5/perlbrew/etc/bashrc

Initialize perlbrew

Run perlbrew init. This will initialize perlbrew and create ~/perl5/perlbrew/.

Then it will tell you to add a line to your ~/.bash_profile. Do that. This line will let perlbrew find perl and configure CPAN.

If you don't have a ~/.bash_profile make one with your favorite text editor or run...

echo 'source ~/perl5/perlbrew/etc/bashrc' >> ~/.bash_profile

Install a recent perl in your home directory

As of this writing, the latest version of perl is 5.16.3. Let's install that.

perlbrew install perl-5.16.3

This will download, build, test and install perl. It will take anywhere from 5 minutes to half an hour depending on how fast your Internet and computer is. Have a sandwich.

Switch to that perl

Tell perlbrew that you want your default perl to be the 5.16.3 you just installed.

perlbrew switch perl-5.16.3

You can check that worked by running perl -v. It should say This is perl 5, version 16, subversion 3 (v5.16.3) built for something-something-something and then a copyright and license.

Install cpanm

cpanm is what we'll be using to install perl5i. perlbrew can take care of installing and configuring it.

perlbrew install-cpanm

You can check that worked by running which cpanm. The result should be something like /home/yourname/perl5/perlbrew/bin/cpanm.

Install perl5i using cpanm

And finally, you can install perl5i!

cpanm perl5i

This will install a lot of modules. It could take a while. Kick back and relax.

Check perl5i is installed

Now you can test that perl5i is installed by running...

perl -e 'use perl5i::2; say "Hello perl5i!"'

And you should see Hello perl5i!.

Congratulations!

Clone this wiki locally