Don't ask to ask, just ask | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I have an older legacy module that returns me a hash with a couple of hundred keys. This module is in use by several other parts of the application so rewriting it is not desirable. The hash that is returned to me has some of the values as hash references. My desire is to write the hash out as XML using XML::Simple. Part of the trouble is that some of the keys have spaces in them which means the XML is not well formed. Keys in the hash references also suffer this affliction. What I cannot get my mind around is how to parse through the hash and hash references, then use a regex to strip the spaces from the keys, and result in a hash with XML valid keys.
Once I have printed the XML file, I am done with the data so changing the keys at this point will not impact any other processes. Here is what I have come up with at this point (but it does not seem to be affecting the hash references)
Any insight would be appreciated
g_White
In reply to removing the spaces from keys of a complex hash by gwhite
|
|