DavidFerrington has asked for the wisdom of the Perl Monks concerning the following question:
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::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.<?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>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: error from XML::Simple
by ikegami (Patriarch) on Feb 19, 2010 at 21:15 UTC | |
|
Re: error from XML::Simple
by Khen1950fx (Canon) on Feb 19, 2010 at 21:56 UTC |