Categories

Monday, 30 December 2013

How to Install Perl modules using Cpan

Hi,

Below is the steps to install perl modules using cpan(Comprehensive Perl Archive Network) in a CentOS machine.

The CPAN's main purpose is to help programmers locate modules and programs not included in the Perl standard distribution

It will act as a command line interpretor through which we can install perl modules.

You can get more details about Cpan in the wiki link http://en.wikipedia.org/wiki/CPAN.

sudo  perl -MCPAN -e shell

Above command will drop you in the CPAN shell.


cpan shell -- CPAN exploration and modules installation (v1.9402)
Enter 'h' for help.

cpan[1]> 


Now you can install a perl module. If you want to install a perl
module named Email::Sender, then you need to issue the below command.

cpan[1]> install Email::Sender

That is install module::name(Email is the module here and Sender is the name)

Once the installation shows as succesfull, then you can test it by listing installed perl modules using the command

# instmodsh

Available commands are:
   l            - List all installed modules
   m <module>   - Select a module
   q            - Quit the program
cmd? l
Installed modules are:
   Authen::SASL
   CPAN::Meta::Requirements
   CPAN::Meta::YAML
   Capture::Tiny
   Class::Load
   Class::Method::Modifiers
   Data::OptList
   Data::Serializer
   Devel::GlobalDestruction
   Devel::StackTrace
   Digest::SHA
   Dist::CheckConflicts
   Email::Abstract
   Email::Address
   Email::Date::Format
   Email::MIME
   Email::MIME::ContentType
   Email::MIME::CreateHTML
   Email::MIME::Encodings
   Email::MessageID
   Email::Sender
   Email::Simple
   ExtUtils::CBuilder
   ExtUtils::Config
   ExtUtils::Helpers
   ExtUtils::InstallPaths
   ExtUtils::MakeMaker
   File::Policy
   File::Slurp
   HTML::TokeParser::Simple
   IPC::Cmd
   Import::Into
   JSON::PP
   List::MoreUtils
   Locale::Maketext::Simple
   Log::Trace
   MIME::Tools
   MIME::Types
   MRO::Compat
   Mail::Sender
   Module::Build
   Module::Build::Tiny
   Module::CoreList
   Module::Implementation
   Module::Load
   Module::Load::Conditional
   Module::Metadata
   Module::Runtime
   Moo
   MooX::Types::MooseLike
   Package::Stash
   Params::Check
   Params::Util
   Parse::CPAN::Meta
   Perl
   Perl::OSType
   Role::Tiny
   Sub::Exporter
   Sub::Exporter::Progressive
   Sub::Install
   Sub::Override
   Test::Requires
   Test::Simple
   Test::Tester
   Throwable
   Try::Tiny
   parent
   strictures
   version

That's all . ..............

No comments:

Post a Comment

Ad