http://qs1969.pair.com?node_id=39061


in reply to XML::Simple

I want a lightweight module to do easy stuff with config files, i read the above and tried to install LWP::Simple However, LWP::Simple depends on XML::Parser and Storable. I have Storable of course but XML::Parser needs a C library called "expat" which is not available as a stable debian package Ok ok sourgeforge is nice and I don't really mind building stuff from tar balls but "Simple"?? Not really

Replies are listed 'Best First'.
RE: RE: XML::Simple
by mirod (Canon) on Oct 30, 2000 at 19:03 UTC

    XML::Simple (and not LWP::Simple) is simple to use. As for installing it, I don't see what the problem is with typing the usual make/make test/su/make install mantra.

    I am afraid that if you want to process XML in Perl you will have to install XML::Parser, including the expat library. Unix users usually have gcc around and XML::Parser comes pre-installed with the Activestates port on windows. So it really shouldn't be a problem.

    The only real problem that you might come accross is actually that you might have too many versions of expat installed, as some of the Apache tools come with their own, dynamically linked and slightly incompatible version of the library. See the XML::Parser review for more details. By the way a team including Clark Cooper, the maintainer for XML::Parser, Apache people and even (gasp!) Python developers (Python XML tools are also based on expat) is working on the problem.

      expat can be a pain.

      It does not compile on Tru64 (Digital^WCompaq^WHP Unix on alpha), so effectively you cannot process XML with perl on Tru64.

      Update: On Tru64 gcc is not recommended, the vendor delivers a C-compiler that is better than gcc. Perl is almost invariably compiled with the vendor suplied compiler (which is a bit pickier than gcc in adhering to standards and error checking). Thus some^Wtoo many OS projects are unavailable on Tru64 - but this is getting a bit OT.

      XML::Parser 2.29 and earlier were supplied with a version of expat that compiles almost as many places as Perl, I have hung on to that version ;-)

        Fear no more htoug, there are several ways to process XML without expat:

        XML::Parser::Lite, included in Paul Kulchenko's Soap::Lite, is a pure Perl XML Parser that emulates XML::Parser. It requires Perl 5.6.0 at least.

        Matt Sergeant is working on a pure Perl parser: XML::SAX::PurePerl. It is in alpha stage and requires bleadperl (does bleadperl compile on Tru64?).

        You can also try XML::LibXML for a parser that's not based on Expat (but on the Gnome XML library libxml2) and that should compile on most platform with gcc.

        Of course all XML::Parser based modules won't work then, but SAX based ones will.

Re: RE: XML::Simple
by moodster (Hermit) on Oct 23, 2001 at 22:40 UTC
    I know I'm replying to a post made over a year ago, but I want to point out that for debian users, there is now an easy way to install XML::Simple. Just do
    apt-get install libxml-simple-perl
    and you don't have to mess around with expat.

    Anyone tried building expat under cygwin on an NT machine? I've given up.

Re: RE: XML::Simple
by Anonymous Monk on Mar 14, 2001 at 03:54 UTC
    If you really don't want to install XML::Parser, then look at some of the other config modules. I like Config::IniFiles