I am wondering if anyone could help me to understand the art of passing data into a perl script and outputting the data into an XML file.

Please help if you can. I am learning as I go with all of your wonderful knowledge.

peace to all
dez L

"HDR" "from""here""to there" "INI" "123""4444""10.10.10.10" "PER" "A1""14""Fred""Flintstone""03061925""111111111" "PER" "A2""17""Barney""Rubble ""03061927""222222222" "ADR" "A1""111 Rock River Lane""Bedrock""IL""55555" "ADR" "A2""113 Rock River Lane""Bedrock""IL""55555" "EMP" "A1""Rock Foundry""Dinosaur Driver""42000""30""07" "EMP" "A2""Rock Foundry""Clerical Office""41000""25""10" "CBP" "CBI""A1" 0 1 2 05/12/99 07/22/99 "CBP" "CBI""A1" 0 2 3 05/11/65 07/06/71 "CBP" "TRW""A2" 0 1 1 06/05/71 10/24/75 "EOS" "EOS"
So if I take this in, how do I create an XML Tree that looks like the following...

What I really need help with is reading this information into my perl code, not the manipulation of the data.

<?xmlversion = "1.0"?> <APPLICATION> <ACCOUNT> <BEGIN>from</BEGIN> <JOURNEY>here</JOURNEY> <DESTINATION>to there</DETINATION> <COMPANY_CODE>123</COMPANY_CODE> <PORT_ADDRESS>4444</PORT_ADDRESS> <IP_ADDRESS>10.10.10.10</PORT_ADDRESS> </ACCOUNT> <CUSTOMER> <ENTITY_ID>A1</ENTITY_ID> <UNIQUE_ID>14</UNIQUE_ID> <BIRTHDATE>030619</BIRTHDATE> <SSN>111111111</SSN> <NAME> <FIRST_NAME>Fred</FIRST_NAME> <LAST_NAME>Flintstone</LAST_NAME> </NAME> <ADDRESS> <STREET>111 Rock River Lane</STREET> <CITY>Bedrock</CITY> <STATE>IL</STATE> <ZIP>55555</ZIP> </ADDRESS> <EMPLOYMENT> <EMPLOYER>Rock Foundry</EMPLOYER> <OCCUPATION>Dinosaur Driver</OCCUPATION> <SALARY>42000</SALARY> <YEARS_EMPLOYED>30</YEARS_EMPLOYED> <MONTHS_EMPLOYED>7</MONTHS_EMPLOYED> </EMPLOYMENT> </CUSTOMER> <CUSTOMER> <ENTITY_ID>A2</ENTITY_ID> <UNIQUE_ID>17</UNIQUE_ID> <BIRTHDATE>03061927</BIRTHDATE> <SSN>222222222</SSN> <NAME> <FIRST_NAME>Barney</FIRST_NAME> <LAST_NAME>Rubble</LAST_NAME> </NAME> <ADDRESS> <STREET>113 Rock River Lane</STREET> <CITY>Bedrock</CITY> <STATE>IL</STATE> <ZIP>55555</ZIP> </ADDRESS> <EMPLOYMENT> <EMPLOYER>Rock Foundry</EMPLOYER> <OCCUPATION>Clerical Office</OCCUPATION> <SALARY>41000</SALARY> <YEARS_EMPLOYED>25</YEARS_EMPLOYED> <MONTHS_EMPLOYED>10</MONTHS_EMPLOYED> </EMPLOYMENT> </CUSTOMER> <CREDIT_BUREAU> <ENTITY_ID>A1</ENTITY_ID> <UNIQUE_ID>14</UNIQUE_ID> <BUREAU>CBI</BUREAU> <THIRTY_DAYS_LATE>0</THIRTY_DAYS_LATE> <SIXTY_DAYS_LATE>1</SIXTY_DAYS_LATE> <NINETY_DAYS_LATE>2</NINETY_DAYS_LATE> <DATE_BEGAN>05/12/1999</DATE_BEGAN> <DATE_PAID_OFF>07/22/1999</DATE_PAID_OFF> </CREDIT_BUREAU> <CREDIT_BUREAU> <ENTITY_ID>A1</ENTITY_ID> <UNIQUE_ID>14</UNIQUE_ID> <BUREAU>CBI</BUREAU> <THIRTY_DAYS_LATE>0</THIRTY_DAYS_LATE> <SIXTY_DAYS_LATE>2</SIXTY_DAYS_LATE> <NINETY_DAYS_LATE>3</NINETY_DAYS_LATE> <DATE_BEGAN>05/11/1965</DATE_BEGAN> <DATE_PAID_OFF>07/06/1971</DATE_PAID_OFF> </CREDIT_BUREAU> <CREDIT_BUREAU> <ENTITY_ID>A2</ENTITY_ID> <UNIQUE_ID>17</UNIQUE_ID> <BUREAU>TRW</BUREAU> <THIRTY_DAYS_LATE>0</THIRTY_DAYS_LATE> <SIXTY_DAYS_LATE>1</SIXTY_DAYS_LATE> <NINETY_DAYS_LATE>1</NINETY_DAYS_LATE> <DATE_BEGAN>06/05/1971</DATE_BEGAN> <DATE_PAID_OFF>10/24/1975</DATE_PAID_OFF> </CREDIT_BUREAU> </APPLICATION>

Edit: 2001-09-16


In reply to Developing away here. by basicdez

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.