Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
395 views
in Technique[技术] by (71.8m points)

Manual installation of a Perl Module

I have downloaded the module Digest::SHA1 and extracted it to a directory (../Digest-SHA1-2.13/) , then copied all the SHA1.* files into (../Digest-SHA1-2.13/Digest)

and in the perl script, I did : use Digest::SHA1; launching the script like this:

perl -I ../Digest-SHA1-2.13/Digest perlscriptname.pl

I get this error:

Can't locate loadable object for module Digest::SHA1 in @INC

I assume it has something to do with a shared library (*.so)?, I have no idea how to continue from here.

I can install it directly using CPAN (-MCPAN) module, as I dont have permissions on that server to do that, and can install only locally (where the application is running). My final goal is to use Algorithm::CouponCode which is dependent on Digest::SHA1

The weird part is, that I have Digest::SHA1 installed (perl -MDigest::SHA1 -e 'print $Digest::SHA1::VERSION' shows version 2.11), still Algorithm::CouponCode (which is installed the same way I did with Digest::SHA1) complains it can find it in @INC

thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Use this recipe for manually installing perl modules:

tar zxf Digest-SHA1-2.13.tar.gz
cd Digest-SHA1-2.13
perl Makefile.PL
make
make test
make install

Note that some distributions will have a Build.PL file instead of Makefile.PL. In that case use this recipe:

tar zxf ...
cd ...
perl Build.PL
./Build
./Build test
./Build install

(You may be able to get by with just running make install and ./Build install.)

If you need to alter the installation dir then use:

perl Makefile.PL INSTALL_BASE=...

or

perl Build.PL --install_base ...

depending on the kind of module.

For more info see the perldoc for ExtUtils::MakeMaker::FAQ and Module::Build


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...