diotalevi has asked for the wisdom of the Perl Monks concerning the following question:
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
⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Should IO::YAML ignore leading comments?
by dynamo (Chaplain) on Sep 18, 2007 at 19:17 UTC | |
by clinton (Priest) on Sep 19, 2007 at 11:02 UTC | |
by dynamo (Chaplain) on Sep 20, 2007 at 22:35 UTC | |
Re: Should IO::YAML ignore leading comments?
by Anonymous Monk on Sep 23, 2007 at 00:44 UTC | |
by nkuitse (Sexton) on Sep 23, 2007 at 00:47 UTC |
Back to
Seekers of Perl Wisdom