Perl

From Cheatsheet
Revision as of 09:46, 11 December 2010 by Admin (talk | contribs)
Jump to navigation Jump to search

This is a Guide to using Perl, and installing and fixing modules.

One of the cpan mirrors that can be used for reference on modules names and requirements.

http://www.cpan.org/

Installation commands

You can install a module with the following command.

cpan -i 

You can force an installation of a module with the following command.

cpan -fi 

Will show you the contents of the @INC, Which is essentially the path's that the installer is going to pull from and look in.

perl -V

In the event that a forced installation does not work, take the above command perl -V and look for what you are trying to install and remove it manually.


General PERL tactics

To update all perl modules use this script.

/scripts/checkperlmodules

To list all Perl modules and put them into a file for easy searching.

perl -MFile::Find=find -MFile::Spec::Functions -Tlwe 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC' > Perlmodules.txt

Then if you wanted to find the imagemagick perl module do the following.

cat Perlmodules.txt |grep -i imagemagick