Does your box have XML::Parser on it? Install XML::Simple in your user space, then. Yes, it's a pain. Yes, it's worth it. XML parsing is a complex, often subtle problem that's difficult to get right -- so let other people get it right, and use the wheels they invent.

If you don't have the requisite modules for XML::Simple (and that includes a compiled Expat library, IIRC), you're in deeper trouble. You might have some luck with XML::Parser::Lite, which I haven't tried but seems to be entirely Perl-based. If you insist on building your own parser, consider using XML::RegExp.

It might be easier to seek a political solution to the problem (i.e. have your manager lean on the systems people until XML/Simple.pm appears in your @INC).

I don't mean to be condescending, but parsing XML really is a lot harder than you think. Writing a half-assed collection of regexes (you'd have more luck using Text::Balanced, of course) that breaks on 90% of the XML out there is easy. Getting it to work properly is insanely hard. (I've been there. I gave up.) Telling your boss that your parser reads XML, but not XML with newfangled features foo, bar, and baz, is probably not acceptable.

Good luck.

--
:wq


In reply to Re(3): XML parsing by FoxtrotUniform
in thread XML parsing by Anonymous Monk

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.