in reply to Config file to tree format with id, parent, key, value
I'm assuming you do not need that exact format. Do you really need the id and parent to point to line numbers? As long as you can get and set the node values, it should not matter to know the id/parent. There are several formats that can express nested mapping/sequence and support comments, e.g. YAML and TOML. If you are willing to forgo comments, there's JSON. And there's always Perl itself (you specify "configuration" as Perl code).
Somewhat related formats include Apachish (Config::Apachish::Reader) and Config::General. And, you know, XML.
If you want to preserve comments after writing back to configuration file, there are Config::IniFiles or Config::IOD, but these are INI-like. (IOD can store hashes and arrays too, though).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Config file to tree format with id, parent, key, value
by arthur_accioly (Initiate) on Nov 02, 2016 at 02:22 UTC |