IO::YAML may be used to read and write YAML streams one document (i.e., one value) at a time.