In this we will see how to install PERL modules in Linux/Unix. Some times it is required to enhance a program capabilities by including a piece of code. Instead of we writing a code we can check if any modules are available at cpan.org which can be downloaded for free of cost. We can even install a module manually too. In this post we will see how to install a module in both ways.

Installing a PERL module through CPAN

Make sure that CPAN command is installed in your machine and configured. For steps click here.
Once you configure cpan command we can use it by just typing cpan at the command prompt.

	cpan

Output:

	surendra@linuxnix.com :~$ cpan
Terminal does not support AddHistory.

 

 

cpan shell — CPAN exploration and modules installation (v2.00)
Enter 'h' for help.

cpan[1]> install App::Prove::State

or direct cpan install command as shown below.

	cpan install App::Prove::State

Output:

	surendra@linuxnix.com :~$ cpan install App::Prove::State
Reading '/home/surendra/.cpan/Metadata'
Database was generated on Thu, 13 Jun 2013 19:41:02 GMT
Running install for module 'App::Prove::State'
Running make for O/OV/OVID/Test-Harness-3.28.tar.gz
Fetching with LWP:
http://ftp.lip6.fr/pub/perl/CPAN/authors/id/O/OV/OVID/Test-Harness-3.28.tar.gz
Fetching with LWP:
http://ftp.lip6.fr/pub/perl/CPAN/authors/id/O/OV/OVID/CHECKSUMS
Checksum for /home/surendra/.cpan/sources/authors/id/O/OV/OVID/Test-Harness-3.28.tar.gz ok

 

 

CPAN.pm: Building O/OV/OVID/Test-Harness-3.28.tar.gz

Checking if your kit is complete…
Looks good
Writing Makefile for Test::Harness
Writing MYMETA.yml and MYMETA.json
cp lib/TAP/Parser/Result/Pragma.pm blib/lib/TAP/Parser/Result/Pragma.pm
cp lib/TAP/Parser/Iterator/Array.pm blib/lib/TAP/Parser/Iterator/Array.pm
cp lib/App/Prove/State/Result.pm blib/lib/App/Prove/State/Result.pm
cp lib/TAP/Base.pm blib/lib/TAP/Base.pm
cp lib/TAP/Formatter/Console/ParallelSession.pm blib/lib/TAP/Formatter/Console/ParallelSession.pm
cp lib/TAP/Parser/Result.pm blib/lib/TAP/Parser/Result.pm
cp lib/TAP/Formatter/Console/Session.pm blib/lib/TAP/Formatter/Console/Session.pm
cp lib/TAP/Parser/Result/YAML.pm blib/lib/TAP/Parser/Result/YAML.pm
cp lib/TAP/Parser/Scheduler/Job.pm blib/lib/TAP/Parser/Scheduler/Job.pm
cp lib/TAP/Parser.pm blib/lib/TAP/Parser.pm
cp lib/TAP/Parser/SourceHandler/Handle.pm blib/lib/TAP/Parser/SourceHandler/Handle.pm
cp lib/TAP/Parser/IteratorFactory.pm blib/lib/TAP/Parser/IteratorFactory.pm
cp lib/TAP/Parser/Iterator.pm blib/lib/TAP/Parser/Iterator.pm
cp lib/TAP/Formatter/Color.pm blib/lib/TAP/Formatter/Color.pm
cp lib/TAP/Parser/Iterator/Process.pm blib/lib/TAP/Parser/Iterator/Process.pm
cp lib/TAP/Parser/Grammar.pm blib/lib/TAP/Parser/Grammar.pm
cp HACKING.pod blib/lib/Test/HACKING.pod
cp lib/Test/Harness.pm blib/lib/Test/Harness.pm
cp lib/TAP/Formatter/Base.pm blib/lib/TAP/Formatter/Base.pm
cp lib/TAP/Formatter/File/Session.pm blib/lib/TAP/Formatter/File/Session.pm
cp lib/TAP/Parser/Utils.pm blib/lib/TAP/Parser/Utils.pm
cp lib/TAP/Parser/ResultFactory.pm blib/lib/TAP/Parser/ResultFactory.pm
cp lib/TAP/Parser/Result/Bailout.pm blib/lib/TAP/Parser/Result/Bailout.pm
cp lib/TAP/Parser/Multiplexer.pm blib/lib/TAP/Parser/Multiplexer.pm
cp lib/TAP/Object.pm blib/lib/TAP/Object.pm
cp lib/TAP/Parser/SourceHandler/Perl.pm blib/lib/TAP/Parser/SourceHandler/Perl.pm
cp lib/TAP/Parser/Result/Version.pm blib/lib/TAP/Parser/Result/Version.pm
cp lib/TAP/Parser/YAMLish/Writer.pm blib/lib/TAP/Parser/YAMLish/Writer.pm
cp lib/TAP/Parser/Result/Unknown.pm blib/lib/TAP/Parser/Result/Unknown.pm
cp lib/TAP/Parser/YAMLish/Reader.pm blib/lib/TAP/Parser/YAMLish/Reader.pm
cp lib/TAP/Parser/Scheduler.pm blib/lib/TAP/Parser/Scheduler.pm
cp lib/TAP/Parser/Result/Plan.pm blib/lib/TAP/Parser/Result/Plan.pm
cp lib/TAP/Parser/SourceHandler.pm blib/lib/TAP/Parser/SourceHandler.pm
cp lib/TAP/Parser/SourceHandler/Executable.pm blib/lib/TAP/Parser/SourceHandler/Executable.pm
cp lib/TAP/Parser/Result/Test.pm blib/lib/TAP/Parser/Result/Test.pm
cp lib/App/Prove/State/Result/Test.pm blib/lib/App/Prove/State/Result/Test.pm
cp lib/TAP/Parser/SourceHandler/RawTAP.pm blib/lib/TAP/Parser/SourceHandler/RawTAP.pm
cp lib/TAP/Parser/Source.pm blib/lib/TAP/Parser/Source.pm
cp lib/TAP/Formatter/Console.pm blib/lib/TAP/Formatter/Console.pm
cp lib/TAP/Parser/Iterator/Stream.pm blib/lib/TAP/Parser/Iterator/Stream.pm
cp lib/TAP/Parser/SourceHandler/File.pm blib/lib/TAP/Parser/SourceHandler/File.pm
cp lib/TAP/Harness/Beyond.pod blib/lib/TAP/Harness/Beyond.pod
cp lib/TAP/Formatter/Session.pm blib/lib/TAP/Formatter/Session.pm
cp lib/App/Prove.pm blib/lib/App/Prove.pm
cp lib/App/Prove/State.pm blib/lib/App/Prove/State.pm
cp lib/TAP/Harness.pm blib/lib/TAP/Harness.pm
cp lib/TAP/Formatter/File.pm blib/lib/TAP/Formatter/File.pm
cp lib/TAP/Parser/Aggregator.pm blib/lib/TAP/Parser/Aggregator.pm
cp lib/TAP/Parser/Scheduler/Spinner.pm blib/lib/TAP/Parser/Scheduler/Spinner.pm
cp lib/TAP/Parser/Result/Comment.pm blib/lib/TAP/Parser/Result/Comment.pm
cp bin/prove blib/script/prove
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' — blib/script/prove
Manifying blib/man1/prove.1p
Manifying blib/man3/TAP::Parser::Result::Pragma.3pm
Manifying blib/man3/App::Prove::State::Result.3pm
Manifying blib/man3/TAP::Parser::Iterator::Array.3pm
Manifying blib/man3/TAP::Base.3pm
Manifying blib/man3/TAP::Formatter::Console::ParallelSession.3pm
Manifying blib/man3/TAP::Parser::Result.3pm
Manifying blib/man3/TAP::Formatter::Console::Session.3pm
Manifying blib/man3/TAP::Parser::Scheduler::Job.3pm
Manifying blib/man3/TAP::Parser::Result::YAML.3pm
Manifying blib/man3/TAP::Parser.3pm
Manifying blib/man3/TAP::Parser::SourceHandler::Handle.3pm
Manifying blib/man3/TAP::Parser::IteratorFactory.3pm
Manifying blib/man3/TAP::Parser::Iterator.3pm
Manifying blib/man3/TAP::Formatter::Color.3pm
Manifying blib/man3/TAP::Parser::Iterator::Process.3pm
Manifying blib/man3/TAP::Parser::Grammar.3pm
Manifying blib/man3/Test::HACKING.3pm
Manifying blib/man3/Test::Harness.3pm
Manifying blib/man3/TAP::Formatter::File::Session.3pm
Manifying blib/man3/TAP::Formatter::Base.3pm
Manifying blib/man3/TAP::Parser::Result::Bailout.3pm
Manifying blib/man3/TAP::Parser::ResultFactory.3pm
Manifying blib/man3/TAP::Parser::Utils.3pm
Manifying blib/man3/TAP::Parser::SourceHandler::Perl.3pm
Manifying blib/man3/TAP::Object.3pm
Manifying blib/man3/TAP::Parser::Multiplexer.3pm
Manifying blib/man3/TAP::Parser::YAMLish::Writer.3pm
Manifying blib/man3/TAP::Parser::Result::Version.3pm
Manifying blib/man3/TAP::Parser::Result::Unknown.3pm
Manifying blib/man3/TAP::Parser::YAMLish::Reader.3pm
Manifying blib/man3/TAP::Parser::Scheduler.3pm
Manifying blib/man3/TAP::Parser::Result::Plan.3pm
Manifying blib/man3/TAP::Parser::SourceHandler.3pm
Manifying blib/man3/TAP::Parser::SourceHandler::Executable.3pm
Manifying blib/man3/TAP::Parser::Result::Test.3pm
Manifying blib/man3/App::Prove::State::Result::Test.3pm
Manifying blib/man3/TAP::Parser::SourceHandler::RawTAP.3pm
Manifying blib/man3/TAP::Formatter::Console.3pm
Manifying blib/man3/TAP::Parser::Source.3pm
Manifying blib/man3/TAP::Parser::Result::Comment.3pm
Manifying blib/man3/TAP::Parser::Iterator::Stream.3pm
Manifying blib/man3/TAP::Parser::SourceHandler::File.3pm
Manifying blib/man3/TAP::Harness::Beyond.3pm
Manifying blib/man3/TAP::Formatter::Session.3pm
Manifying blib/man3/App::Prove::State.3pm
Manifying blib/man3/App::Prove.3pm
Manifying blib/man3/TAP::Harness.3pm
Manifying blib/man3/TAP::Formatter::File.3pm
Manifying blib/man3/TAP::Parser::Aggregator.3pm
Manifying blib/man3/TAP::Parser::Scheduler::Spinner.3pm
OVID/Test-Harness-3.28.tar.gz
/usr/bin/make — OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/compat/*.t
t/000-load.t ……………….. 1/97 # Testing Test::Harness 3.28, Perl 5.014002, /usr/bin/perl
t/000-load.t ……………….. ok
t/aggregator.t ……………… ok
t/bailout.t ………………… ok
t/base.t …………………… ok
t/callbacks.t ………………. ok
t/compat/env.t ……………… ok
t/compat/env_opts.t …………. ok
t/compat/failure.t ………….. ok
t/compat/inc-propagation.t …… ok
t/compat/inc_taint.t ………… ok
t/compat/nonumbers.t ………… ok
t/compat/regression.t ……….. ok
t/compat/subclass.t …………. ok
t/compat/switches.t …………. ok
t/compat/test-harness-compat.t .. ok
t/compat/version.t ………….. ok
t/console.t ………………… ok
t/errors.t …………………. ok
t/file.t …………………… ok
t/glob-to-regexp.t ………….. ok
t/grammar.t ………………… ok
t/harness-bailout.t …………. ok
t/harness-subclass.t ………… ok
t/harness.t ………………… ok
t/iterator_factory.t ………… ok
t/iterators.t ………………. ok
t/multiplexer.t …………….. ok
t/nested.t …………………. ok
t/nofork-mux.t ……………… ok
t/nofork.t …………………. ok
t/object.t …………………. ok
t/parse.t ………………….. ok
t/parser-config.t …………… ok
t/parser-subclass.t …………. ok
t/perl5lib.t ……………….. ok
t/premature-bailout.t ……….. ok
t/process.t ………………… ok
t/prove.t ………………….. ok
t/proveenv.t ……………….. ok
t/proverc.t ………………… ok
t/proverun.t ……………….. ok
t/proveversion.t ……………. ok
t/regression.t ……………… ok
t/results.t ………………… ok
t/scheduler.t ………………. ok
t/source.t …………………. ok
t/source_handler.t ………….. ok
t/spool.t ………………….. ok
t/state.t ………………….. ok
t/state_results.t …………… ok
t/streams.t ………………… ok
t/taint.t ………………….. ok
t/testargs.t ……………….. ok
t/unicode.t ………………… ok
t/utils.t ………………….. ok
t/yamlish-output.t ………….. ok
t/yamlish-writer.t ………….. ok
t/yamlish.t ………………… ok
All tests successful.
Files=58, Tests=11762, 13 wallclock secs ( 1.93 usr 0.16 sys + 7.35 cusr 1.18 csys = 10.62 CPU)
Result: PASS
OVID/Test-Harness-3.28.tar.gz
/usr/bin/make test — OK
Running make install
Installing /home/surendra/perl5/lib/perl5/TAP/Parser.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Base.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Object.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Harness.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/SourceHandler.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Iterator.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Aggregator.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/IteratorFactory.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Source.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Grammar.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Result.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Scheduler.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/ResultFactory.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Utils.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Multiplexer.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/SourceHandler/Handle.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/SourceHandler/Executable.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/SourceHandler/RawTAP.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/SourceHandler/Perl.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/SourceHandler/File.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Result/Unknown.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Result/Pragma.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Result/Comment.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Result/Test.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Result/Bailout.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Result/Plan.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Result/YAML.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Result/Version.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Iterator/Process.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Iterator/Stream.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Iterator/Array.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Scheduler/Job.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/Scheduler/Spinner.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/YAMLish/Reader.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Parser/YAMLish/Writer.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Harness/Beyond.pod
Installing /home/surendra/perl5/lib/perl5/TAP/Formatter/Console.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Formatter/Base.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Formatter/Session.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Formatter/Color.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Formatter/File.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Formatter/File/Session.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Formatter/Console/ParallelSession.pm
Installing /home/surendra/perl5/lib/perl5/TAP/Formatter/Console/Session.pm
Installing /home/surendra/perl5/lib/perl5/App/Prove.pm
Installing /home/surendra/perl5/lib/perl5/App/Prove/State.pm
Installing /home/surendra/perl5/lib/perl5/App/Prove/State/Result.pm
Installing /home/surendra/perl5/lib/perl5/App/Prove/State/Result/Test.pm
Installing /home/surendra/perl5/lib/perl5/Test/HACKING.pod
Installing /home/surendra/perl5/lib/perl5/Test/Harness.pm
Installing /home/surendra/perl5/man/man1/prove.1p
Installing /home/surendra/perl5/man/man3/TAP::Formatter::Session.3pm
Installing /home/surendra/perl5/man/man3/TAP::Harness.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::SourceHandler::Executable.3pm
Installing /home/surendra/perl5/man/man3/TAP::Formatter::File::Session.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Result::Comment.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Scheduler::Spinner.3pm
Installing /home/surendra/perl5/man/man3/TAP::Formatter::Console::ParallelSession.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::SourceHandler::RawTAP.3pm
Installing /home/surendra/perl5/man/man3/TAP::Base.3pm
Installing /home/surendra/perl5/man/man3/Test::HACKING.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Result::Version.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::SourceHandler.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::SourceHandler::File.3pm
Installing /home/surendra/perl5/man/man3/TAP::Object.3pm
Installing /home/surendra/perl5/man/man3/TAP::Formatter::Console::Session.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Scheduler.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Iterator::Stream.3pm
Installing /home/surendra/perl5/man/man3/Test::Harness.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::SourceHandler::Handle.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Aggregator.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Result::Unknown.3pm
Installing /home/surendra/perl5/man/man3/App::Prove::State::Result.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::ResultFactory.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Result::YAML.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Result::Test.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Result::Pragma.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Source.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Multiplexer.3pm
Installing /home/surendra/perl5/man/man3/TAP::Formatter::Base.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::SourceHandler::Perl.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Scheduler::Job.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Utils.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Result.3pm
Installing /home/surendra/perl5/man/man3/TAP::Formatter::Color.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Grammar.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::YAMLish::Reader.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Result::Bailout.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Iterator::Process.3pm
Installing /home/surendra/perl5/man/man3/App::Prove::State.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::IteratorFactory.3pm
Installing /home/surendra/perl5/man/man3/TAP::Harness::Beyond.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Result::Plan.3pm
Installing /home/surendra/perl5/man/man3/App::Prove.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::YAMLish::Writer.3pm
Installing /home/surendra/perl5/man/man3/TAP::Formatter::File.3pm
Installing /home/surendra/perl5/man/man3/TAP::Formatter::Console.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Iterator.3pm
Installing /home/surendra/perl5/man/man3/App::Prove::State::Result::Test.3pm
Installing /home/surendra/perl5/man/man3/TAP::Parser::Iterator::Array.3pm
Installing /home/surendra/perl5/bin/prove
Appending installation info to /home/surendra/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/perllocal.pod
OVID/Test-Harness-3.28.tar.gz
/usr/bin/make install — OK

From the above it is conformed the module got installed successfully.

 

Install PERL module manually/locally

Step1: Download your module from cpan.org site to your desired directory(say it /tmp/perl/modules)

	wget http://search.cpan.org/CPAN/authors/id/B/BN/BNEGRAO/Net-SSH-Expect-1.09.tar.gz

Output:

	surendra@linuxnix.com :/tmp/perl/modules$ wget http://search.cpan.org/CPAN/authors/id/B/BN/BNEGRAO/Net-SSH-Expect-1.09.tar.gz
–2013-06-14 13:23:48– http://search.cpan.org/CPAN/authors/id/B/BN/BNEGRAO/Net-SSH-Expect-1.09.tar.gz
Resolving search.cpan.org (search.cpan.org)… 199.15.176.161
Connecting to search.cpan.org (search.cpan.org)|199.15.176.161|:80… connected.
HTTP request sent, awaiting response… 302 Found
Location: http://www.cpan.org/authors/id/B/BN/BNEGRAO/Net-SSH-Expect-1.09.tar.gz [following] –2013-06-14 13:23:49– http://www.cpan.org/authors/id/B/BN/BNEGRAO/Net-SSH-Expect-1.09.tar.gz
Resolving www.cpan.org (www.cpan.org)… 212.117.177.118, 207.171.7.177, 2a01:608:2:4::2, …
Connecting to www.cpan.org (www.cpan.org)|212.117.177.118|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 15074 (15K) [application/x-gzip] Saving to: ‘Net-SSH-Expect-1.09.tar.gz’

 

 

100%[======================================>] 15,074 50.6KB/s in 0.3s

2013-06-14 13:23:49 (50.6 KB/s) – ‘Net-SSH-Expect-1.09.tar.gz’ saved [15074/15074]

surendra@linuxnix.com :/tmp/perl/modules$ ls
Net-SSH-Expect-1.09.tar.gz

Step 2: Unzipping and untar the module which we downloaded.

	gzip -d Net-SSH-Expect-1.09.tar.gz
tar xvf Net-SSH-Expect-1.09.tar

Output:

	surendra@linuxnix.com :/tmp/perl/modules$ gzip -d Net-SSH-Expect-1.09.tar.gz surendra@linuxnix.com :/tmp/perl/modules$ ls
Net-SSH-Expect-1.09.tar
surendra@linuxnix.com :/tmp/perl/modules$ tar xvf Net-SSH-Expect-1.09.tar
Net-SSH-Expect-1.09/
Net-SSH-Expect-1.09/lib/
Net-SSH-Expect-1.09/lib/Net/
Net-SSH-Expect-1.09/lib/Net/SSH/
Net-SSH-Expect-1.09/lib/Net/SSH/Expect.pod
Net-SSH-Expect-1.09/lib/Net/SSH/Expect.pm
Net-SSH-Expect-1.09/MANIFEST
Net-SSH-Expect-1.09/META.yml
Net-SSH-Expect-1.09/t/
Net-SSH-Expect-1.09/t/Net-SSH-Expect.t
Net-SSH-Expect-1.09/Changes
Net-SSH-Expect-1.09/README
Net-SSH-Expect-1.09/Makefile.PL
surendra@linuxnix.com :/tmp/perl/modules$ ls
Net-SSH-Expect-1.09 Net-SSH-Expect-1.09.tar
surendra@linuxnix.com :/tmp/perl/modules$ cd Net-SSH-Expect-1.09/
surendra@linuxnix.com :/tmp/perl/modules/Net-SSH-Expect-1.09$ ls
Changes lib Makefile.PL MANIFEST META.yml README t
surendra@linuxnix.com :/tmp/perl/modules/Net-SSH-Expect-1.09$ perl Makefile.PL
Checking if your kit is complete…
Looks good


Step 3: Installing a module by using perl command

	perl Makefile.PL

Output

	surendra@linuxnix.com :/tmp/perl/modules/Net-SSH-Expect-1.09$ perl Makefile.PL Writing Makefile for Net::SSH::Expect
Writing MYMETA.yml and MYMETA.json
surendra@linuxnix.com :/tmp/perl/modules/Net-SSH-Expect-1.09$

Step 5: Now run make, make test and make install commands.

	make
make test
make install

 

 

Output:
surendra@linuxnix.com :/tmp/perl/modules/Net-SSH-Expect-1.09$ make
cp lib/Net/SSH/Expect.pod blib/lib/Net/SSH/Expect.pod
cp lib/Net/SSH/Expect.pm blib/lib/Net/SSH/Expect.pm
Manifying blib/man3/Net::SSH::Expect.3pm
surendra@linuxnix.com :/tmp/perl/modules/Net-SSH-Expect-1.09$ make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/Net-SSH-Expect.t .. ok
All tests successful.
Files=1, Tests=1, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.04 cusr 0.00 csys = 0.06 CPU)
Result: PASS
surendra@linuxnix.com :/tmp/perl/modules/Net-SSH-Expect-1.09$ make install
Appending installation info to /home/surendra/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/perllocal.pod

Note: It is advisable to install a module through cpan command as it resolves dependencies. Where as this manual process will have dependencies issues. This is similar to rpm and yum commands.

The following two tabs change content below.
Mr Surendra Anne is from Vijayawada, Andhra Pradesh, India. He is a Linux/Open source supporter who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. He works as Devops Engineer with Taggle systems, an IOT automatic water metering company, Sydney . You can contact him at surendra (@) linuxnix dot com.