Take a look at Kwalify. This is a perl implementation of the same-named schema language for data structures (as opposed to tree-like XML structures). I am not sure if this can be made work with ini files, but it works fine with YAML, JSON and similar serialization formats.