Perl: Difference between revisions

From Cheatsheet
Jump to navigation Jump to search
No edit summary
m 4 revisions
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
This is a Guide to using Perl, and installing and fixing modules.
=== 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.
One of the cpan mirrors that can be used for reference on modules names and requirements.
  http://www.cpan.org/
  http://www.cpan.org/


=== Installation commands ===
== Installation commands ==


You can install a module with the following command.
You can install a module with the following command.
Line 16: Line 16:


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.
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.
To Force perl database update do the following.
/scripts/perlinstaller --force Bundle::DBD::mysql
== 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

Latest revision as of 23:51, 23 October 2014

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.

To Force perl database update do the following.

/scripts/perlinstaller --force Bundle::DBD::mysql

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