in reply to Fastest XML parser that can run under ActivePerl on Windows?

XML::Bare : doesn't install

Just wondering why that is...  The core of the module is a rather straightforward piece of C code, which doesn't appear to be using any fancy constructs available only with one specific compiler.  And the Makefile.PL does have entries for Win32/msvc.  IOW, I guess it should work...

  • Comment on Re: Fastest XML parser that can run under ActivePerl on Windows?

Replies are listed 'Best First'.
Re^2: Fastest XML parser that can run under ActivePerl on Windows?
by Xenofur (Monk) on Apr 26, 2009 at 23:15 UTC
    FWIW, the error is this:
    CPAN.pm: Going to build C/CO/CODECHILD/XML-Bare-0.43.tar.gz 'x' outside of string in unpack at Makefile.PL line 28. (C:\Perl\bin\perl.exe Makefile.PL INSTALLDIRS=site exited with 512) CPAN::Reporter: Makefile.PL result is 'unknown', Stopped with an error +.
    I didn't try looking into how to fix this, as any local fix wouldn't be useful to users of my script elsewhere.

      I can replicate the problem with Perl 5.10.0 (it's fine with 5.8.8).  The respective snippet is (with the debug line added):

      my $ver = $]*1000; # correct for possibile division problems print "\$]=$], \$ver=$ver\n"; # debug my ($major,$minor,$sub) = unpack("AA3xA3","$ver");

      Output 5.8.8:

      $]=5.008008, $ver=5008.008

      Output 5.10.0:

      $]=5.010000, $ver=5010 'x' outside of string in unpack at ./760220.pl line 10.

      (note the missing .XXX part in $ver, which makes unpack() complain)

      Apparently, this has never been tried with a .0 release...   (Update: bug reported)

        Apparently, this has never been tried with a .0 release...

        I've just tried this with a number of Win32 perl-5.10.0 installations, and can't reproduce the problem, as the offending code is not executed (because has_cc() is true).

        Incidentally, if using a Microsoft compiler you may need this patch to Bare.xs:
        --- Bare.xs_orig Mon Apr 27 12:34:29 2009 +++ Bare.xs Mon Apr 27 13:00:50 2009 @@ -97,13 +97,13 @@ if( SvTYPE( SvRV(*cur) ) == SVt_PVHV ) { AV *newarray = newAV(); SV *newarrayref = newRV_noinc( (SV *) newarray ); - + + SV *ob = cxml2obj(); SV *newref = newRV( (SV *) SvRV( *cur ) ); - + hv_delete( output, curnode->name, curnode->namelen, 0 ); hv_store( output, curnode->name, curnode->namelen, newarray +ref, 0 ); av_push( newarray, newref ); - SV *ob = cxml2obj(); av_push( newarray, ob ); } else { @@ -141,7 +141,9 @@ int numatts = curnode->numatt; SV *attval; SV *attatt; - + HV *output = newHV(); + SV *outputref = newRV( (SV *) output ); + int length = curnode->numchildren; if( ( length + numatts ) == 0 ) { if( curnode->vallen ) { @@ -151,9 +153,6 @@ return newSViv( 1 ); //&PL_sv_undef; } - HV *output = newHV(); - SV *outputref = newRV( (SV *) output ); - if( length ) { curnode = curnode->firstchild; for( i = 0; i < length; i++ ) { @@ -273,6 +272,9 @@ c_parsefile(filename) char * filename CODE: + char *data; + unsigned long len; + FILE *handle; PERL_HASH(vhash, "value", 5); PERL_HASH(ahash, "_att", 4); PERL_HASH(chash, "comment", 7); @@ -280,9 +282,6 @@ PERL_HASH(ihash, "_i", 2 ); PERL_HASH(zhash, "_z", 2 ); PERL_HASH(cdhash, "_cdata", 6 ); - char *data; - unsigned long len; - FILE *handle; handle = fopen(filename,"r"); fseek( handle, 0, SEEK_END );
        (I'll report that, too - if I don't forget.)

        Cheers,
        Rob