我編譯perl的一個重新定位的@INC如下:這裏用我剛剛編譯好的perl發生了什麼?
$ sh Configure -des -D prefix=~/perl -Duserelocatableinc
我成立後,我的路徑等我得到如下:
$ perl -e 'use strict; print "ok"'
Can't locate strict.pm in @INC (@INC contains: ../lib/site_perl/5.12.4/darwin-2level ../lib/site_perl/5.12.4 ../lib/5.12.4/darwin-2level ../lib/5.12.4 .) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
如果我這樣做,不過,一切一切都OK?
$ `which perl` -e 'use strict; print "ok"'
我做錯了什麼?這是在OS X
下面是輸出的perl -V:
$ perl -V
Can't locate Config.pm in @INC (@INC contains: ../lib/site_perl/5.12.4/darwin-2level ../lib/site_perl/5.12.4 ../lib/5.12.4/darwin-2level ../lib/5.12.4 .).
BEGIN failed--compilation aborted.
$ `which perl` -V
Summary of my perl5 (revision 5 version 12 subversion 4) configuration:
Platform:
osname=darwin, osvers=10.8.0, archname=darwin-2level
uname='darwin fenchurch-2.local 10.8.0 darwin kernel version 10.8.0: tue jun 7 16:33:36 pdt 2011; root:xnu-1504.15.3~1release_i386 i386 '
config_args='-des -D prefix=/Users/kd/perl -Duserelocatableinc'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include',
optimize='-O3',
cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include'
ccversion='', gccversion='4.2.1 (Apple Inc. build 5666) (dot 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='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector -L/usr/local/lib -L/opt/local/lib'
libpth=/usr/local/lib /opt/local/lib /usr/lib
libs=-lgdbm -ldbm -ldl -lm -lutil -lc
perllibs=-ldl -lm -lutil -lc
libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -L/opt/local/lib -fstack-protector'
Characteristics of this binary (from libperl):
Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP USE_64_BIT_ALL
USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO
USE_PERL_ATOF
Built under darwin
Compiled at Jul 16 2011 15:44:19
%ENV:
PERL_MM_USE_DEFAULT="1"
@INC:
/Users/kd/perl/lib/site_perl/5.12.4/darwin-2level
/Users/kd/perl/lib/site_perl/5.12.4
/Users/kd/perl/lib/5.12.4/darwin-2level
/Users/kd/perl/lib/5.12.4
.
什麼你安裝perl用? – zellio
有沒有可能你有一個perl的別名? –
沒有別名perl。我使用上面的configure命令安裝了perl,然後make && make test && make install – singingfish