Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Dive data with automatic array indexingby Loops (Curate) |
on Oct 27, 2014 at 05:25 UTC ( [id://1105077]=note: print w/replies, xml ) | Need Help?? |
Hi Chris, I'm not sure exactly your end goal, or whether the $VAR1 data from the Dumper output you show is valuable to you at all. But if not you might consider using one of the config file parsers from CPAN. It might take some coercing to get one to conform to your needs, but you seem to have the flexibility to change the format of your files; an automated translation should be doable. Plus you'll get the escaping and quoting features, that you mention are lacking in your code. Here's a quick example
Which displays:
If you absolutely need the keys that have undefined values as in your example output, the code can be changed to include them. It should be as easy to write a translator from your existing files into this format, as for the new syntax you are proposing. However, other CPAN options might be more to your liking.
In Section
Seekers of Perl Wisdom
|
|