今天运行perl脚本的时候,发现一个找不到“Recursive.pm”的错误:
Can't locate File/Copy/Recursive.pm in @INC (@INC contains: /opt/local/lib/perl5/site_perl/5.12.4/darwin-thread-multi-2level
BEGIN failed--compilation aborted at xxxx.pl line 6.
解决的方法是安装缺少的Recursive.pm,敲入下面的命令:
android:antt lee$ perl -MCPAN -e install "install File::Copy::Recursive"
或者
android:antt lee$ sudo cpan install File::Copy::Recursive
Password:
Going to read '/Users/lee/.cpan/Metadata'
Database was generated on Tue, 23 Sep 2014 22:29:02 GMT
Running install for module 'File::Copy::Recursive'
Running make for D/DM/DMUEY/File-Copy-Recursive-0.38.tar.gz
Checksum for /Users/lee/.cpan/sources/authors/id/D/DM/DMUEY/File-Copy-Recursive-0.38.tar.gz ok
CPAN.pm: Going to build D/DM/DMUEY/File-Copy-Recursive-0.38.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for File::Copy::Recursive
cp Recursive.pm blib/lib/File/Copy/Recursive.pm
Manifying blib/man3/File::Copy::Recursive.3pm
DMUEY/File-Copy-Recursive-0.38.tar.gz
/usr/bin/make -- OK
'YAML' not installed, will not store persistent state
Running make test
PERL_DL_NONLAZY=1 /opt/local/bin/perl5.12 "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/1.t .. ok
All tests successful.
Files=1, Tests=1, 0 wallclock secs ( 0.03 usr 0.00 sys + 0.03 cusr 0.00 csys = 0.06 CPU)
Result: PASS
DMUEY/File-Copy-Recursive-0.38.tar.gz
/usr/bin/make test -- OK
Running make install
Installing /opt/local/lib/perl5/site_perl/5.12.4/File/Copy/Recursive.pm
Installing /opt/local/share/perl5.12/siteman/man3/File::Copy::Recursive.3pm
Appending installation info to /opt/local/lib/perl5/5.12.4/darwin-thread-multi-2level/perllocal.pod
DMUEY/File-Copy-Recursive-0.38.tar.gz
/usr/bin/make install -- OK