... if you change
$XML::Simple::PREFERRED_PARSER = 'XML::Parser';
to
$XML::Simple::PREFERRED_PARSER = 'XML::LibXML::SAX';
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:
$XML::Simple::PREFERRED_PARSER = 'XML::LibXML::SAX';
throws the error:
Can't locate object method "new" via package "XML::SAX" at C:/Perl/sit
+e/lib/XML/
SAX/ParserFactory.pm 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/SAX.pm l
ine 64
at C:/Perl/lib/XML/Simple.pm line 370
So ++thanks again; it appears to fit my needs nicely.
s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.