in reply to Parse XML into CSV Files

I haven taken a look at the code and the XML document and tried to run it. I see many points for improvements, so many that I don't quite know where to start;)

While your approach should work I am going to suggest a different approach all together. XML to CSV sounds like a standard application of XSLT to me. See Sal Mangano's XSLT Cookbook, it has a recipe for transforming XML into delimited data. There are modules on CPAN to do XSLT processing.

HTH
Harry

Replies are listed 'Best First'.
Re^2: Parse XML into CSV Files
by dmsparts (Sexton) on Jul 21, 2009 at 14:52 UTC
    Thanks for the Help,
    I have no control over the XML. it is exported from a vehicle management program in order to put the details of vehicles onto a website.

    I have generated a couple of variables to use later on in the script, once the Vehicle processing has happened.

    Do i have to use the "my" before variables, i have not in the past and things seemed to work, however i have seen some scripts that do use it

    I will have a look at the XSLT, but i might have found the answer to my problem in another post on here.

    just need to work out what to do if the XML field is Blank.

    Cheers
      Do i have to use the "my" before variables

      No it's not mandatory, but it often makes sense to do so, i.e. explicitly declare variables that you want to use and give them a specific scope. See perldoc for documentation. Using strict and warnings is also not mandatory but using them in combination with my would for example have given you the information that some of the variables are never used.