If this is a homework then I would like to -- both you (for not running the code under the debugger, using Data::Dumper or generally searching this site and the web for information on Perl and XML) and your teacher. XML SHOULD NOT BE PARSED USING REGEXPs (unless you seriously know what you're doing, as Paul Kulchenko in XML::Parser::Lite or Matt Sergeant in his new pure Perl parser). See On XML parsing for a few reasons (and I am not even mentioning non-ascii encodings in that post).

Now if you are looking for resources on Perl and XML you can have a look at xml.com, which carries a series of really good articles by Kip Hampton on Perl and XML, I have a couple of resources on xmltwig.com and the Mother of all XML resources is of course The XML Cover Pages, which even has a section on Perl and XML.

Update: Oh my! I forgot to mention a web site dedicated to Perl and XML: xmlperl.com!


In reply to Re: Perl with XML by mirod
in thread Perl with XML 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.