Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^2: XML::Simple giving a non-specific error

by liverpole (Monsignor)
on Mar 12, 2010 at 00:28 UTC ( #828170=note: print w/replies, xml ) Need Help??

in reply to Re: XML::Simple giving a non-specific error
in thread XML::Simple giving a non-specific error

... if you change
$XML::Simple::PREFERRED_PARSER = 'XML::Parser';

That output certainly looks more like what I want, even though I never said my code contained:

$XML::Simple::PREFERRED_PARSER = 'XML::Parser';
I've just installed XML::SAX with ppm, but the addition of this line:
throws the error:
Can't locate object method "new" via package "XML::SAX" at C:/Perl/sit +e/lib/XML/ SAX/ line 41, <DATA> line 13.

But thanks, that does give me an alternative that I can do more research on.   And as I said, the XML is really basic (and reasonably short), so I'm quite certain speed won't be an issue.

Update:  On a hunch I tried "ppm install XML::LibXML::SAX", and that got me past the "Cannot locate object" error above.  Now I'm getting a much nicer error message:

Error while parsing XML: Opening and ending tag mismatch: ERROR line 8 and ROOT Premature end of data in tag ERROR line 8 Premature end of data in tag ROOT line 3 at C:/Perl/site/lib/XML/LibXM +L/ l ine 64 at C:/Perl/lib/XML/ line 370

So ++thanks again; it appears to fit my needs nicely.


Replies are listed 'Best First'.
Re^3: XML::Simple giving a non-specific error
by ikegami (Pope) on Mar 12, 2010 at 01:07 UTC

    I never said my code contained $XML::Simple::PREFERRED_PARSER = 'XML::Parser';

    I realise it wasn't there explicitly, but by virtue of not setting it explicitly and having XML::Parser installed, it's as if you had.

    Can't locate object method "new" via package "XML::SAX

    Hum, weird. Did you also install XML-LibXML to provide XML::LibXML::SAX? It would be a bad failure mode if not having XML::LibXML::SAX is the cause of that error, but you never know.

    ( I see from your update that this was indeed the problem )

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://828170]
[stevieb]: I'm learning that no matter how good a piece of software is at what it's supposed to do, it's a piece of shit without providing any API documentation. (Talking about C++ here currently). Seriously... write software for an embedded platform and make...
[stevieb]: guess based on the sparse examples, and the header files that are spread out illogically?
[stevieb]: document the public facing functions/methods people... ALL OF THEM.

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2017-05-28 23:45 GMT
Find Nodes?
    Voting Booth?