我有一些旧的Perl代码,我正在尝试使用我构建的Perl 5.14.1版本。但由于某种原因,我没有Perl模块NDBM_File。
$ perl -MNDBM_File -e1;
Can't locate NDBM_File.pm in @INC (@INC contains: /apps/perl-5.14.1/lib/dev_perl/x86_64-linux-thread-multi /apps/perl-5.14.1/lib/dev_perl /apps/perl-5.14.1/lib/vendor_perl/5.14.1/x86_64-linux-thread-multi /apps/perl-5.14.1/lib/vendor_perl/5.14.1 /apps/perl-5.14.1/lib/5.14.1/x86_64-linux-thread-multi /apps/perl-5.14.1/lib/5.14.1 /apps/perl-5.14.1/lib/site_perl .).
BEGIN failed--compilation aborted.
这是我得到的perl -V输出......
Summary of my perl5 (revision 5 version 14 subversion 1) configuration:
Platform:
osname=linux, osvers=2.6.32-220.17.1.el6.x86_64, archname=x86_64-linux-thread-multi
uname='linux myhost.mydomain 2.6.32-220.17.1.el6.x86_64 #1 smp thu apr 26 13:37:13 edt 2012 x86_64 x86_64 x86_64 gnulinux '
config_args='-Dcc=gcc -A ccflags=-fPIC -Dprefix=/apps/perl-5.14.1 -Dsitelib=/apps/perl-5.14.1/lib/dev_perl -Dvendorprefix=/apps/perl-5.14.1 -Dotherlibdirs=/apps/perl-5.14.1/lib/site_perl -Duseithreads=define -de'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fPIC -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-D_REENTRANT -D_GNU_SOURCE -fPIC -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
ccversion='', gccversion='4.4.6 20110731 (Red Hat 4.4.6-3)', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -fstack-protector -L/usr/local/lib'
libpth=/usr/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /usr/lib /lib64 /usr/lib64 /usr/local/lib64
libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.12.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.12'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT
USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF
USE_REENTRANT_API
Built under linux
Compiled at Aug 27 2012 14:20:48
@INC:
/apps/perl-5.14.1/lib/dev_perl/x86_64-linux-thread-multi
/apps/perl-5.14.1/lib/dev_perl
/apps/perl-5.14.1/lib/vendor_perl/5.14.1/x86_64-linux-thread-multi
/apps/perl-5.14.1/lib/vendor_perl/5.14.1
/apps/perl-5.14.1/lib/5.14.1/x86_64-linux-thread-multi
/apps/perl-5.14.1/lib/5.14.1
/apps/perl-5.14.1/lib/site_perl
.
我确实有这个档案......
/apps/perl-5.14.1/lib/5.14.1/Memoize/NDBM_File.pm
...但是“使用NDBM_File”失败了。
我是否构建了错误的Perl?
答案 0 :(得分:4)
来自https://metacpan.org/module/AnyDBM_File:
odbm ndbm sdbm gdbm bsd-db
---- ---- ---- ---- ------
Linkage comes w/ perl yes yes yes yes yes
Src comes w/ perl no no yes no no
...
这意味着唯一支持“开箱即用”的DBM后端是SDBM_File。
我想你必须安装libgdbm-dev
包并重新编译你的Perl。