Update here. I am a new comer to Perl, and it takes one day to investigate this issue. I have not fixed it, while I find some useful info.

[root@sparts Unicode-Map8-0.13-kCcefS]# pwd /root/.cpan/build/Unicode-Map8-0.13-kCcefS [root@sparts Unicode-Map8-0.13-kCcefS]# make clean [root@sparts Unicode-Map8-0.13-kCcefS]# make ... map8x.c: In function ‘map8_recode8’: map8x.c:321: warning: pointer targets in passing argument 1 of ‘strlen +’ differ in signedness map8x.c:314: warning: unused variable ‘uc’ ... [root@sparts Unicode-Map8-0.13-kCcefS]# make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/callback.t .. ok t/map8.t ........ No subtests run t/compat.t .... ok t/unistr.t .... ok

I use "make testdb TEST_FILE=t/map8.t", when excuting the below line:

print "not " unless $no->recode8($l1, "xyz{|}") eq "xyzæøå";

I see " DB<2> x $! 0 'Bad file descriptor'", so I guess it seems caused by recode8(). I commented all recode() and modify the test count in map8.t, and then run "make test" again, it is "PASSED". In order to look more deeply, I created the simply test file including recode8:(named cm.t)

print "1..1\n"; use strict; use Unicode::Map8 qw(NOCHAR); print "MAPS_DIR = $Unicode::Map8::MAPS_DIR\n"; my $l1 = Unicode::Map8->new("latin1") || die; my $no = Unicode::Map8->new("no") || die; #print "not " unless $no->recode8($l1, "xyz{|}") eq "xyzæøå"; my $t1 = $no->recode8($l1, "xyz{|}"); print "ok 1\n";

make test again

[root@sparts Unicode-Map8-0.13-kCcefS]# make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/callback.t .. ok t/cm.t ........ Usage: Unicode::Map8::recode8(m1, m2, str) at t/cm.t l +ine 15. t/cm.t ........ Dubious, test returned 9 (wstat 2304, 0x900) Failed 1/1 subtests t/compat.t .... ok t/unistr.t .... ok Test Summary Report ------------------- t/cm.t (Wstat: 2304 Tests: 0 Failed: 0) Non-zero exit status: 9 Parse errors: Bad plan. You planned 1 tests but ran 0. Files=5, Tests=20, 0 wallclock secs ( 0.05 usr 0.04 sys + 0.14 cusr + 0.06 csys = 0.29 CPU) Result: FAIL Failed 1/5 test programs. 0/20 subtests failed. make: *** [test_dynamic] Error 255

I also see recode8() is defined in Map8.xs

recode8(m1, m2, str) Map8* m1 Map8* m2 PREINIT: STRLEN len; STRLEN rlen; char* res; INPUT: char* str = SvPV(ST(2), len); CODE: RETVAL = newSV(len + 1); SvPOK_on(RETVAL); res = SvPVX(RETVAL); map8_recode8(m1, m2, str, res, len, &rlen); res[rlen] = '\0'; SvCUR_set(RETVAL, rlen); OUTPUT: RETVAL

It needs 3 parameters:($m1,$m2,str), and I try to modify the cm.t as "my $t1 = $no->recode8($no, $l1, "xyz{|}");" and then "make test" also show the same error. Here, I do not know how to do it next, can you pls give any hint? Thanks, Phillip


In reply to Re^2: cpan install Unicode::Map8 failed by PhillipHuang
in thread cpan install Unicode::Map8 failed by PhillipHuang

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.