1000s of rules in 1 (or a few) huge files, or many small files?
If many small to medium files, you could try Text::Balanced to help you extract brace-delimited blocks of text.
If the files are too big read in to memory, you will need to parse them a line at a time. When you encounter a {, push the preceding section name in to an @array, add it to a %hash (as a key) and create another hash to hold the following entries as you parse them. When you encounter a }, pop the most recent name off the @array. As you process key/value pairs, add them to the %hash for the current (sub)section. When done, you will have a hash of hashes of hashes of ..., nested like the config data.
In reply to Re: Parsing a config file with braces and nested braces
by RonW
in thread Parsing a config file with braces and nested braces
by IamtheGorf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |