Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi All- I am pretty much a beginner at Perl - lots of C, beginner at Perl. I have installed a few modules now, and written a few small programs that work .

I have been picking through the XML::Simple maze a bit. Wrote a couple of programs, began to wonder about other parsers. Even got, compiled and installed Expat and LibXML2. btw- this is a Mac, Perl 5.8.1, OS 10.3.7

Now, however, my install is confused. After trying Very Hard to read and do the right thing, its still a problem. Specifics on request. However, the XML::Simple tests now fail, with
Can't locate auto/XML/Parser/Expat/parse_strin.al'

Current everything..
# Package Version
# perl 5.8.1
# XML::Simple 2.14
# Storable 2.08
# XML::Parser 2.34
# XML::SAX 0.14
# XML::NamespaceSupport 1.09
# XML::Parser::Expat 2.34 (default parser)

I had tried to set the parser in ParserDetails.ini. Nothing worked. I went to an OS 10.4 machine with an untouched Perl, installed ONLY expat and Parser, not SAX at all, and it worked fine! So, I tried using ExtUtils modrm.pl to get rid of SAX entirely. That executed, but the next run of the makefile for XML::Simple 'detected' that SAx was installed! I made a new makefile, MakefileNoSax.PL, which just reversed the tests, preferring Parser first, ran it, but the tests fail. Installed SAX again, then Simple, the tests fail. You get the picture.

So now I am an unhappy state. Any suggestions on unwedging this mess? thanks in advance -Brian

Replies are listed 'Best First'.
Re: XML::Simple Install hosed
by shmem (Chancellor) on Aug 28, 2006 at 08:59 UTC
    Perhaps instmodsh can help you to clean up the mess.

    BTW, it's a good idea to keep a log of each install, to see what has been done and installed to which place... ;-)

    <update>

    Can't locate auto/XML/Parser/Expat/parse_strin.al'

    This line looks strange to me. First, I guess it should read parse_string, and it has 8.3 chars; then, there's no function parse_strin or such and there's no AutoSplit stuff in XML::Parser::Expat, so there should be no *.al file at all - but a shared object to load. At least this is the case with my XML::Parser::Expat install (which is 2.34, too). </update>

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
      >This line looks strange to me. First, I guess it should read parse_string, and it has 8.3 chars

      yes, the parse_xxx functions are implemented in all of the parsers, it seems. (I looked in LibXML for example)

      I am not following what you say about AutoSplit...
      What is instmodsh?
      Another data point is that when running a small program using XML::Simple, I get a different .al, with a full name:

      File "HD:Library:Perl:5.8.1:XML:Simple.pm"; Line 287: Can't locate auto/XML/Parser/Expat/parse_uri.al in @INC (@INC contains: /Users/bmarshall/Sources/XmlSimpleTest /System/Library/Perl/5.8.1/darwin-thread-multi-2level /System/Library/Perl/5.8.1 /Library/Perl/5.8.1/darwin-thread-multi-2level /Library/Perl/5.
      btw- it seems that this .pod records all of the installs

      perldoc /System/Library/Perl/5.8.6/darwin-thread-multi-2level/perllocal.pod

      under OS 10.4.x
Re: XML::Simple Install hosed
by Anonymous Monk on Aug 28, 2006 at 20:40 UTC
    In the case of a complete, new Perl, since the ExtUtuls modrm.pl does not seem to be thorough enough, I downloaded 5.8.8,and ran configure -d from the /Library/Perl/5.8.8 directory. It seems to want to put the new perl in /usr/local, /usr/local/lib. Not exactly what was there before... (btw, quite a few details there guys) This seems fishy to me for new module install and such... (read unlucky) *sigh*

    still wondering where to go now...
      Two solutions so far...

      Patch the code in XML::Simple that tests for the presence of a Parser.. forcing TRUE makes it work

      or, setting the package var, as doucmented

      $XML::Simple::PREFERRED_PARSER = 'XML::Parser';

      -Brian