I have difficulty understanding what exactly you do in your code. You seem to over-complicate things. There are several modules available for parsing CSV files, no need to reinvent the weel. It would probably reduce your code by 30% or so. I would not worry too much about footprint, you control the opening/closing of files and wether you slurp them or not.
Also for generating the XML files you can use a module. You could for example start by taking a look at XML::Simple which seems enough for what you need to do.