IO::YAML may be used to read and write YAML streams one document (i.e., one value) at a time. WWW: https://metacpan.org/release/IO-YAML