From charlesreid1

(Created page with "=Modules= More info here: http://www.cpan.org/modules/index.html ==Finding== Use the Comprehensive Perl Archive Network (CPAN) to find useful Perl modules. Most Perl modules ...")
 
Line 8: Line 8:


==Installing==
==Installing==
===Before you install perl modules: cpanm===


The <code>cpanm</code> utility can be used to easily install perl modules.  To install this utility, run the command:
The <code>cpanm</code> utility can be used to easily install perl modules.  To install this utility, run the command:
Line 28: Line 30:
* less/more (pager program)
* less/more (pager program)


Note that if you are running Mac OS X, you will also need to install developer tools (via XCode on the installation CD, or by downloading and installing XCode 3 from Apple).
Once you've run the above command, cpanm will be a script located in:
<pre>
~/.cpan/build/App-cpanminus-1.4004/blib/script/cpanm
</pre>
===Installing perl modules with cpanm===
You can install a module found on CPAN by running the command
<pre>
$ cpanm Module::Name
</pre>
If you run this as a regular user, it will put everything in
<pre>
~/perl5
</pre>
If you run this as the superuser, it will put everything in
<pre>
/usr/local/bin
</pre>
and/or, if you're on a Mac, in
<pre>
/Library/Perl/5.8.8
</pre>
Alternatively, use the runtime option <code>--local-lib=/path/to/perl/install/location</code>, or set the environmental variable <code>PERL_CPANM_OPT="--local-lib=/path/to/perl/install/location"</code>.
===Updating===
You can update your cpanm by running
<pre>
$ cpanm App::cpanminus
</pre>
or
<pre>
$ cpanm --self-upgrade
</pre>
==Perl Module Example==


Graphviz example goes here


=References=
=References=

Revision as of 21:11, 11 May 2011

Modules

More info here: http://www.cpan.org/modules/index.html

Finding

Use the Comprehensive Perl Archive Network (CPAN) to find useful Perl modules. Most Perl modules are on CPAN.

Installing

Before you install perl modules: cpanm

The cpanm utility can be used to easily install perl modules. To install this utility, run the command:

$ cpan App::cpanminus

This will ask several questions and has several prerequisites, including the following:

  • gzip
  • tar
  • unzip
  • make
  • lynx (available via Fink for Mac)
  • wget (available via Fink for Mac)
  • ncftpget (available for most operating systems here: http://www.ncftp.com/download/)
  • ftp
  • gpg
  • less/more (pager program)

Note that if you are running Mac OS X, you will also need to install developer tools (via XCode on the installation CD, or by downloading and installing XCode 3 from Apple).

Once you've run the above command, cpanm will be a script located in:

~/.cpan/build/App-cpanminus-1.4004/blib/script/cpanm

Installing perl modules with cpanm

You can install a module found on CPAN by running the command

$ cpanm Module::Name

If you run this as a regular user, it will put everything in

~/perl5

If you run this as the superuser, it will put everything in

/usr/local/bin

and/or, if you're on a Mac, in

/Library/Perl/5.8.8

Alternatively, use the runtime option --local-lib=/path/to/perl/install/location, or set the environmental variable PERL_CPANM_OPT="--local-lib=/path/to/perl/install/location".


Updating

You can update your cpanm by running

$ cpanm App::cpanminus

or

$ cpanm --self-upgrade


Perl Module Example

Graphviz example goes here

References