This issue turned out to be a bad LD_LIBRARY_PATH :-(

I'm trying to use XML::Simple to parse a VERY simple xml file. The code works when used with perl debug (perl -d), but when run standalone, it fails with

Can't locate object method "new" via package "XML::LibXML::SAX" at /cp +an/5.8.8-2006.03/lib/XML/SAX/ParserFactory.pm line 43.

As far as I can tell, I have the right modules etc, although a little old now. The code is very simple:

#!/perl/5.8.8/bin/perl use 5.8.8; use strict; use warnings; use lib qw( /cpan/5.8.8-2006.03/lib /cpan-extra/5.8.8-2006.07 ); use Data::Dumper; use XML::Simple; my $file = 'test.xml'; my $ref = XMLin($file) or die "Error reading build file ($file): $@"; print Dumper($ref); # -end-

Can anyone suggest my next course of action? I don't have to use Simple, but looking at how to parse something very simple:

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?> <SA> <BUILD> <name>oracle</name> <version>2.4.7</version> <size>672K</size> <date>Thu Nov 8 13:07:18 EST 2007</date> <builder>me</builder> <os>RHEL 3</os> <server>labtest1</server> <command>d2tbuild.pl</command> </BUILD> <SVN> <url>https://svr/prod/Oracle/tags/REL_1.2.3_01</url> <rev>19858</rev> </SVN> </SA>
XML::Parser etc. seeams far to complex. I'm limited on what modules I can use. So most of the newer 'easy' type aren’t available to me.
-- David

In reply to error from XML::Simple by DavidFerrington

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.