User Tools

Site Tools


tutorials:perl_cpan

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tutorials:perl_cpan [2012/03/01 13:57] – created chkuotutorials:perl_cpan [2012/03/01 14:02] (current) – chkuo
Line 4: Line 4:
   * [[http://www.cpan.org/|CPAN]] is a large collection of perl modules.   * [[http://www.cpan.org/|CPAN]] is a large collection of perl modules.
  
-==== Installing modules ====+===== Installing modules =====
 To call the CPAN shell interface, use:  To call the CPAN shell interface, use: 
 <code bash> <code bash>
Line 11: Line 11:
 Using sudo allows for system-wide installation of new modules. When the call is successful, you should see a shell interface: Using sudo allows for system-wide installation of new modules. When the call is successful, you should see a shell interface:
  
-<code sh>+<code>
 cpan[1]>  cpan[1]> 
 </code> </code>
  
 For example, if we want to install bioperl, first we can do a listing with the following command: For example, if we want to install bioperl, first we can do a listing with the following command:
 +<code>
 cpan[1]> d /bioperl/ cpan[1]> d /bioperl/
 +</code>
 +
 +This should generate some output similar to the following:
 +<code>
 CPAN: Storable loaded ok (v2.20) CPAN: Storable loaded ok (v2.20)
 Going to read '/home/chkuo/.cpan/Metadata' Going to read '/home/chkuo/.cpan/Metadata'
Line 37: Line 41:
 Distribution    CRAFFI/Bundle-BioPerl-2.1.8.tar.gz Distribution    CRAFFI/Bundle-BioPerl-2.1.8.tar.gz
 15 items found 15 items found
- +</code> 
 + 
 +From this list, we can see that the ''CJFIELDS/BioPerl-1.6.1.tar.gz'' module is what we want (the newest version). To install: 
 +<code>
 cpan[2]> install CJFIELDS/BioPerl-1.6.1.tar.gz cpan[2]> install CJFIELDS/BioPerl-1.6.1.tar.gz
-  +</code> 
-# the installer will run a bunch of tests here  + 
-# a small number of tests are likely to fail +Usually this should work for most modules and all required dependencies should be installed automatically. Bioperl is unusual because it contains a large number of components and some tests may fail during the installation process. Often these failures do not really matter and we can proceed with force install:  
-# +<code>
-# to install anyway, use 'force install'  +
- +
 cpan[3]> force install CJFIELDS/BioPerl-1.6.1.tar.gz cpan[3]> force install CJFIELDS/BioPerl-1.6.1.tar.gz
 +</code>
  
  
tutorials/perl_cpan.1330581458.txt.gz · Last modified: by chkuo