in reply to duplicate keys in YAML

According to the 1.2 version of the YAML spec "The content of a mapping node is an unordered set of key: value node pairs, with the restriction that each of the keys is unique." so you have badly formed YAML and parsers are free to handle that as they see fit. Do you have any control over the generation of the config file?

If the structures contained in the files are simple you could write a simple parser and handle the multiple entries in whatever fashion makes sense in your application. If you describe the bigger task you are working on we may be able to offer better advice.

Perl is the programming world's equivalent of English