I think it would be easier to provide a good response to this question if you provide us with an example of some YAML input that is not parsing correctly using a Perl YAML module, and then an example of the desired output. I don't know anything about PyYAML, and I've got plenty of other priorities on things I am interested in learning without spending time with it. Sample input, expected output, and actual output will save us research time by allowing us to leverage what you already know, adding to it those things that we already know.