-->
🏠 🔍
SHAREOLITE

Linux Command line Search and Install perl modules from CPAN


Did you know that , perl modules may be directly installed from CPAN website. Only requirement is you have a active internet connection. In this post we show few commands which may be used on a linux system to search & download perl modules from CPAN website. This tool has an advantage that it downloads the necessary dependencies & installs them. 
 
 



Step 1 : Login to the CPAN linux prompt

[shareolite@labserver 00:25:44 shareolite]$ perl -MCPAN -e shell

cpan shell -- CPAN exploration and modules installation (v1.59_54)
ReadLine support available (try 'install Bundle::CPAN')

cpan>

Step 2 : Search for the required module , For example *Excel*

cpan> i /Excel/


Module          XML::Excel      (I/IS/ISTERIN/XML-Excel-0.02.tar.gz)
Module          XML::SAXDriver::Excel (I/IS/ISTERIN/XML-SAXDriver-Excel-0.06.tar.gz)
Module          Xymon::Server::ExcelOutages (D/DA/DAVIDP/Xymon-Server-ExcelOutages-0.03.tar.gz)


Step 3 : Select the module from the list and install 

cpan> install XML::Excel
Running install for module XML::Excel
Running make for I/IS/ISTERIN/XML-Excel-0.02.tar.gz
Fetching with LWP:
  http://perlmirror.indialinks.com/authors/id/I/IS/ISTERIN/XML-Excel-0.02.tar.gz

  CPAN: MD5 security checks disabled because MD5 not installed.
  Please consider installing the MD5 module.

Scanning cache /home/shareolite/.cpan/build for sizes
XML-Excel-0.02/CHANGES
XML-Excel-0.02/Data1.xls
XML-Excel-0.02/Data2.xls
XML-Excel-0.02/Excel.pm
XML-Excel-0.02/MANIFEST
XML-Excel-0.02/Makefile.PL
XML-Excel-0.02/README
XML-Excel-0.02/test.pl

  CPAN.pm: Going to build I/IS/ISTERIN/XML-Excel-0.02.tar.gz

Checking if your kit is complete...
Looks good
Warning: prerequisite Spreadsheet::ParseExcel failed to load: Can't locate Spreadsheet/ParseExcel.pm in @INC (@INC contains: /usr/lib/perl5/5.6.1/i386-linux /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i386-linux /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.6.1/i386-linux /usr/lib/perl5/vendor_perl/5.6.1 /usr/lib/perl5/vendor_perl .) at (eval 4) line 3.
Writing Makefile for XML::Excel
---- Unsatisfied dependencies detected during [I/IS/ISTERIN/XML-Excel-0.02.tar.gz] -----
    Spreadsheet::ParseExcel
Shall I follow them and prepend them to the queue
of modules we are processing right now? [yes]


Hope this helps to some linux perl geeks.
Comments

–>