Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the YAML-LibYAML CPAN distribution.

Report information
The Basics
Id: 82833
Status: resolved
Priority: 0/
Queue: YAML-LibYAML

People
Owner: Nobody in particular
Requestors: voetsjoeba [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Multiple documents are ignored when loading a YAML file
Date: Sun, 20 Jan 2013 17:53:44 +0100
To: bug-YAML-LibYAML [...] rt.cpan.org
From: Jeroen De Ridder <voetsjoeba [...] gmail.com>
YAML::XS v0.38 appears to only load the last-encountered document in a YAML file rather than providing access to all of them. Example YML file "test.yml": --- documentNr: 1 ... --- documentNr: 2 ... Observe the following behaviour of YAML::XS compared to YAML::Tiny. This is running Perl v5.8.8 on RHEL 5 x86_64. $ perl -e 'use Data::Dumper; use YAML::Any qw/LoadFile/; my $x = LoadFile("test.yml"); print Dumper($x);' $VAR1 = { 'documentNr' => 2 }; $ perl -e 'use Data::Dumper; use YAML::Tiny; my $x = YAML::Tiny->read("test.yml"); print Dumper($x);' $VAR1 = bless( [ { 'documentNr' => '1' }, { 'documentNr' => '2' } ], 'YAML::Tiny'); $ There is no apparent way of getting to the first document when using YAML::XS to parse it. I'm not familiar with libyaml, so I can't tell whether this is due to the underlying implementation or due to any post-processing by YAML::XS. Feel free to defer to libyaml's bug tracking if this problem is ultimately due to libyaml.
Please refer to https://github.com/ingydotnet/yaml-libyaml-pm/issues/16 I'm closing this now.