I just started using PERL 1 week ago and I am a programming newbee. Please Help as my company project is relying on this. The Situation: I would like to open an XML file, in this example is Library.xml and edit the XML document using a specific "ISBN" number. After the ISBN number is found, I would like to change the number of pages for the particular book with the matching "ISBN" number. The Problem: now, I can do the above but, I need to save the updated XML with the same name "library.xml" and also maintaining the XML structure of the original XML document. This is where I am stumped. I have tried using XML::DUMPER, and XML::TWIG and may others but have failed. The output does not reflect the original XML structure. PLease help.

In reply to parse, edit and save in the same XML file by veritas_penang

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.