我想在AIX 7.2上從CPAN構建Encode 2.88-3。在化妝測試階段,我收到各種錯誤關於未知字符:Perl:未知的charname N {alpha}
Use of uninitialized value $txt in pattern match (m//) at /usr/opt/perl5/lib/5.20.1/_charnames.pm line 499.
Unknown charname 'alpha' at t/Encode.t line 44, within string
BEGIN not safe after errors--compilation aborted at t/Encode.t line 148.
t/Encode.t .................
Use of uninitialized value $txt in pattern match (m//) at /usr/opt/perl5/lib/5.20.1/_charnames.pm line 459.
Unknown charname 'LATIN SMALL LETTER SHARP S' at t/encoding.t line 77, within string
BEGIN not safe after errors--compilation aborted at t/encoding.t line 165.
t/encoding.t ...............
Use of uninitialized value $txt in pattern match (m//) at /usr/opt/perl5/lib/5.20.1/_charnames.pm line 459.
Unknown charname 'POUND SIGN' at t/mime-header.t line 166, within string
Execution of t/mime-header.t aborted due to compilation errors.
# Looks like your test exited with 2 just after 1.
t/mime-header.t ............
爲了檢驗這是否是一個AIX的問題或與編碼,測試用例的問題,我試圖建立我的Linux系統上的相同版本(Ubuntu的14.04),其中Encode安裝得很好。
要挑選的第一個錯誤:
is "\N{alpha}",substr($uni,0,1),"alpha does not map to symbol 'a'";
看來AIX Perl是無法找到\ N {}字母字符。我在這裏有點迷路 - Perl通常在哪裏搜索這樣的字符?
我需要一個暗示我必須尋找這個問題的方向。有人可以提供一些調試技巧?
perl -V
Summary of my perl5 (revision 5 version 20 subversion 1) configuration:
Platform:
osname=aix, osvers=6.1.0.0, archname=aix-thread-multi
uname='aix blade08 1 6 00003c3ad100 '
config_args='-d -Dprefix=/usr/opt/perl5 -Dcc=xlc_r -Duseshrplib -Dusethreads'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='xlc_r -q32', ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -qlanglvl=extc99 -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES',
optimize='-O',
cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -qlanglvl=extc99 -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT'
ccversion='12.1.0.9', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='ld', ldflags =' -brtl -bdynamic -b32'
libpth=/lib /usr/lib /usr/ccs/lib
libs=-lbind -lnsl -ldbm -ldl -lld -lm -lcrypt -lpthreads -lc
perllibs=-lbind -lnsl -ldl -lld -lm -lcrypt -lpthreads -lc
libc=, so=a, useshrplib=true, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -bE:/usr/opt/perl5/lib/5.20.1/aix-thread-multi/CORE/perl.exp'
cccdlflags=' ', lddlflags='-bhalt:4 -G -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -bnoentry -lpthreads -lc -lm'
Characteristics of this binary (from libperl):
Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
PERL_DONT_CREATE_GVSV
PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV
USE_ITHREADS USE_LARGE_FILES USE_LOCALE
USE_LOCALE_COLLATE USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
USE_REENTRANT_API
Built under aix
Compiled at Feb 6 2015 14:54:29
%ENV:
PERL5LIB="/home/perl_ss/perl5/lib/perl5/aix-thread-multi:/home/perl_ss/perl5/lib/perl5:/usr/local/lib/site_perl/5.8.8:/usr/local/site_perl/common"
PERL5OPT=""
PERL5_CPANPLUS_IS_RUNNING="9961732"
PERL5_CPAN_IS_RUNNING="9961732"
PERL_LOCAL_LIB_ROOT="/home/perl_ss/perl5"
PERL_MB_OPT="--install_base /home/perl_ss/perl5"
PERL_MM_OPT="INSTALL_BASE=/home/perl_ss/perl5"
@INC:
/home/perl_ss/perl5/lib/perl5/aix-thread-multi
/home/perl_ss/perl5/lib/perl5/aix-thread-multi
/home/perl_ss/perl5/lib/perl5
/usr/local/lib/site_perl/5.8.8/aix-thread-multi
/usr/local/lib/site_perl/5.8.8
/usr/local/site_perl/common
/usr/opt/perl5/lib/site_perl/5.20.1/aix-thread-multi
/usr/opt/perl5/lib/site_perl/5.20.1
/usr/opt/perl5/lib/5.20.1/aix-thread-multi
/usr/opt/perl5/lib/5.20.1
/usr/opt/perl5/lib/site_perl/5.8.8
/usr/opt/perl5/lib/site_perl
UPDATE: 問題的進一步檢查使我的結論是,編碼這可能不相關。我啓動了我的調試器並執行了一些測試。請注意如何字符\ N {希臘:阿爾法}在Linux平臺中,但不能在AIX: AIX 7.2:
DB<1> use charnames qw(greek)
DB<2> print "\N{alpha}"
Use of uninitialized value $txt in pattern match (m//) at /usr/opt/perl5/lib/5.20.1/_charnames.pm line 459.
[...]
Unknown charname 'alpha' at (eval 9)[/usr/opt/perl5/lib/5.20.1/perl5db.pl:732] line 2, within string
DB<3> print "\N{U+03B1}"
Wide character in print at (eval 10)[/usr/opt/perl5/lib/5.20.1/perl5db.pl:732] line 2.
[...]
DB<4> print "\N{greek:alpha}"
Use of uninitialized value $txt in pattern match (m//) at /usr/opt/perl5/lib/5.20.1/_charnames.pm line 459.
[...]
Unknown charname 'greek:alpha' at (eval 11)[/usr/opt/perl5/lib/5.20.1/perl5db.pl:732] line 2, within string
的Ubuntu 14.04
DB<1> use charnames qw(greek)
DB<2> print "\N{alpha}"
Unknown charname 'alpha' at (eval 8)[/usr/share/perl/5.18/perl5db.pl:732] line 2, within string
DB<3> print "\N{U+03B1}"
Wide character in print at (eval 9)[/usr/share/perl/5.18/perl5db.pl:732] line 2.
DB<4> print "\N{greek:alpha}"
Wide character in print at (eval 10)[/usr/share/perl/5.18/perl5db.pl:732] line 2.
想有東西弄亂了與AIX字符表?
UPDATE 2: 我開始深究這一點。
Name.pl中缺少AIX:
[email protected]:/usr/opt/perl5/lib/5.20.1/unicore $ ls
Blocks.txt Decomposition.pl Name.pm SpecialCasing.txt UCD.pl
CombiningClass.pl Heavy.pl NamedSequences.txt To lib
與Linux不同:
[email protected]:/usr/share/perl/5.18/unicore $ ls
Blocks.txt Decomposition.pl lib Name.pl SpecialCasing.txt UCD.pl
CombiningClass.pl Heavy.pl NamedSequences.txt Name.pm To version
重新「*我想從CPAN *打造編碼2.88-3」,有CPAN上沒有這樣的事情。 – ikegami
構建Perl時,表是從Unicode數據庫(定義字符及其屬性的文本文件集合)構建的。這是這些文件的問題。不知道該怎麼辦。你有沒有嘗試將Perl安裝到你的主目錄而不是搞亂系統'perl'? – ikegami