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).
In reply to Re: Config file to tree format with id, parent, key, value
by perlancar
in thread Config file to tree format with id, parent, key, value
by arthur_accioly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |