Open Chinstrap

April 3, 2008

Check for Existing CPAN Modules

Filed under: Linux, Perl — t-roy @ 1:48 am

Before installing a CPAN Module it is important to check your system to see if it already exists. In my case I wanted to install the Syntax::Highlight::HTML module . First I run the following command to see if it exists on my system:

$ perl -MSyntax::Highlight::HTML -e 1

If I do not receive an error then the module is already installed. If I receive an error that looks something like this:

Can’t locate Syntax/Highlight/HTML.pm in @INC ….

This could mean that the module is not installed or the module is not in the @INC path.

Check for Existing CPAN Modules

To install the module type:

$ sudo cpan -i Syntax::Highlight::HTML

Install Module with Using cpan

Now the module is installed and ready to use. For more information about installing perl modules type:

$ perldoc perlmodinstall

or try this website

http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlmodinstall.html

Troy

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.