Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I install Perl module without using CPAN.pm?

Tags:

perl

cpan

Is it possible?

like image 793
lamcro Avatar asked Mar 05 '09 18:03

lamcro


People also ask

Can't locate switch pm in @INC you may need to install the switch module?

Installing Switch.pm using CPAN:Open a terminal(Ctrl-Alt-t). Enter the command cpan. At the prompt cpan[1]>, type install Switch. Once completed, Type exit.

How do I force a CPAN module to install?

In this case, I can use “force install” command as shown below to instruct cpan to install the module, despite the fact that some of the tests failed. If the force install works, you'll see “/usr/bin/make install — OK” as the last line in the output as shown below. Note: Don't blindly use force install.


2 Answers

If you download the source code, and read the README file. This will probably tell you you should do

perl Makefile.PL
make
make test
make install

or

perl Build.PL
./Build
./Build test
./Build install
like image 103
Leon Timmermans Avatar answered Sep 19 '22 11:09

Leon Timmermans


If you download the source code, it will generally have a Makefile.PL. You run "perl Makefile.PL; make; make test; make install" and it will build and install for you.

Obviously if you're not using CPAN.pm, you're going to have to deal with dependencies yourself.

Also, if the reason you can't use CPAN.pm is that you don't have permission to install into /usr/lib/perl, you can force CPAN.pm to install locally, but I forget how.

like image 24
Paul Tomblin Avatar answered Sep 18 '22 11:09

Paul Tomblin