Hi Dears,

I have a XML file like below :

I want to customize this xml file by perl code and remove perldata tags, hashref tags. also I want to add employee value in the tag like <employee> not like <item key=" employee"> and also for other tags, I used dumper in this regards.

Is there any easy way to make this XML file simpler?
<perldata> <hashref memory_address="0xa7ab680"> <item key="employee"> <arrayref memory_address="0xa7dc1a8"> <item key="0"> <hashref memory_address="0xa7ab584"> <item key="age"> <hashref memory_address="0xa7ab338"> <item key="dob">10-02-1927</item> </hashref> </item> <item key="department"> <hashref memory_address="0xa7ab1d0"> <item key="departmentname">Operations</item> <item key="title">Manager</item> </hashref> </item> <item key="location"> <hashref memory_address="0xa7ab068"> <item key="town"> <hashref memory_address="0xa7aaffc"> <item key="county">East Ayrshire</item> <item key="name">Auchinleck</item> </hashref> </item> </hashref> </item> <item key="name"> <hashref memory_address="0xa7ab518"> <item key="forename">John</item> <item key="surname">Doe</item> </hashref> </item> <item key="************">M</item> </hashref> </item> <item key="1"> <hashref memory_address="0xa7aae64"> <item key="age"> <hashref memory_address="0xa7aac90"> <item key="dob">05-03-1914</item> </hashref> </item> <item key="department"> <hashref memory_address="0xa78c490"> <item key="departmentname">Internet</item> <item key="title">Watcher</item> </hashref> </item> <item key="location"> <hashref memory_address="0xa798da4"> <item key="town"> <hashref memory_address="0xa798d38"> <item key="county">South A</item> <item key="name">AYR</item> </hashref> </item> </hashref> </item> <item key="name"> <hashref memory_address="0xa7aadf8"> <item key="forename">Craig R.</item> <item key="surname">Moral</item> </hashref> </item> <item key="************">M</item> </hashref> </item> </arrayref> </item> </hashref> </perldata>

In reply to removing perldata , hashref from XML file by SaraMirabi

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.