Ubuntu下安装Perl的扩展包很是简单,只需要简单的步骤就可以了。
sudo cpan cpan> install Bundle::CPANPLUS::Dependencies cpan> install Bundle::CPANPLUS
整个过程需要些时间。当安装完毕,接下来就可以使用cpan命令来安装扩展包了,如要安装Text::Autoformat扩展包,
cpan[3]> install Text::Autoformat Reading ‘/home/richard/.cpan/Metadata‘ Database was generated on Tue, 05 May 2015 10:41:02 GMT Running install for module ‘Text::Autoformat‘ Running make for N/NE/NEILB/Text-Autoformat-1.71.tar.gz Fetching with LWP: http://mirror.as24220.net/pub/cpan/authors/id/N/NE/NEILB/Text-Autoformat-1.71.tar.gz Fetching with LWP: http://mirror.as24220.net/pub/cpan/authors/id/N/NE/NEILB/CHECKSUMS Checksum for /home/richard/.cpan/sources/authors/id/N/NE/NEILB/Text-Autoformat-1.71.tar.gz ok Scanning cache /home/richard/.cpan/build for sizes ............................................................................DONE CPAN.pm: Building N/NE/NEILB/Text-Autoformat-1.71.tar.gz Checking prerequisites... requires: ! Text::Reform is not installed ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the versions of the modules indicated above before proceeding with this installation Created MYMETA.yml and MYMETA.json Creating new ‘Build‘ script for ‘Text-Autoformat‘ version ‘1.71‘ ---- Unsatisfied dependencies detected during ---- ---- NEILB/Text-Autoformat-1.71.tar.gz ---- Text::Reform [requires] Running Build test Delayed until after prerequisites Running Build install Delayed until after prerequisites Running install for module ‘Text::Reform‘ Running make for C/CH/CHORNY/Text-Reform-1.20.tar.gz Fetching with LWP: http://mirror.as24220.net/pub/cpan/authors/id/C/CH/CHORNY/Text-Reform-1.20.tar.gz Fetching with LWP: http://mirror.as24220.net/pub/cpan/authors/id/C/CH/CHORNY/CHECKSUMS Checksum for /home/richard/.cpan/sources/authors/id/C/CH/CHORNY/Text-Reform-1.20.tar.gz ok CPAN.pm: Building C/CH/CHORNY/Text-Reform-1.20.tar.gz Created MYMETA.yml and MYMETA.json Creating new ‘Build‘ script for ‘Text-Reform‘ version ‘1.20‘ Building Text-Reform CHORNY/Text-Reform-1.20.tar.gz ./Build -- OK Running Build test t/00.load.t .. 1/1 # Testing Text::Reform 1.20 t/00.load.t .. ok t/pod.t ...... skipped: Test::Pod 1.14 required for testing POD t/reform.t ... ok All tests successful. Files=3, Tests=67, 0 wallclock secs ( 0.04 usr 0.01 sys + 0.08 cusr 0.03 csys = 0.16 CPU) Result: PASS CHORNY/Text-Reform-1.20.tar.gz ./Build test -- OK Running Build install Building Text-Reform Installing /usr/local/share/perl/5.18.2/Text/Reform.pm Installing /usr/local/man/man3/Text::Reform.3pm CHORNY/Text-Reform-1.20.tar.gz sudo ./Build install -- OK Running Build for N/NE/NEILB/Text-Autoformat-1.71.tar.gz Has already been unwrapped into directory /home/richard/.cpan/build/Text-Autoformat-1.71-u0bs8b CPAN.pm: Building N/NE/NEILB/Text-Autoformat-1.71.tar.gz Building Text-Autoformat NEILB/Text-Autoformat-1.71.tar.gz ./Build -- OK Running Build test t/00.load.t .......... 1/1 # Testing Text::Autoformat 1.71 t/00.load.t .......... ok t/01.ignore.t ........ ok t/02.wide-numbers.t .. ok All tests successful. Files=3, Tests=4, 0 wallclock secs ( 0.04 usr 0.00 sys + 0.13 cusr 0.04 csys = 0.21 CPU) Result: PASS NEILB/Text-Autoformat-1.71.tar.gz ./Build test -- OK Running Build install Building Text-Autoformat Installing /usr/local/share/perl/5.18.2/Text/Autoformat.pm Installing /usr/local/man/man3/Text::Autoformat.3pm NEILB/Text-Autoformat-1.71.tar.gz sudo ./Build install -- OK
时间: 2024-11-15 22:22:32