I've got a very large YAML stream and it begins with a little bit of comments. When I tried using IO::YAML, I found that it treats my leading comments as a separate chunk. Is this a bug?
use IO::YAML;
my $yaml_fh = IO::YAML->new(
handle => \*DATA,
mode => '<',
auto_load => 0,
)
or die "Can't open ...: $!";
while ( not $yaml_fh->eof ) {
my $yaml = <$yaml_fh>;
# Skip comment-only blocks. Is it a bug that this ever happens?
next if /\A(?:^#[^\n]*\n)+\z/m;
}
__DATA__
# this is a comment about the 40MB of YAML documents to follow
---
foo: 1
bar: 2