Subject: | Indentation after empty hash values is not parsed correctly |
Robert Boone came up with a fix for this issue. Example script and patch attached.
Subject: | YAML-Tiny.patch |
--- Tiny.pm.old 2007-04-14 00:09:43.000000000 -0500
+++ Tiny.pm 2007-04-14 00:09:28.000000000 -0500
@@ -264,6 +264,10 @@
# Null hash entry
$hash->{$key} = undef;
}
+ elsif ($indent->[-1] > $indent2 ) {
+ # Null hash entry
+ $hash->{$key} = undef;
+ }
else {
$hash->{$key} = {};
$self->_read_hash( $hash->{$key}, [ @$indent, length($1) ], $lines );
Subject: | yaml_undef_example.pl |
#!/usr/bin/perl
use strict;
use warnings;
use YAML;
use YAML::Tiny;
use Data::Dumper qw{Dumper};
my $data = <<'YAML';
---
Test:
optmods:
Bad: 0
Foo: 1
Long: 0
version: 5
Test_IncludeA:
optmods:
Test_IncludeB:
optmods:
_meta:
name: 'test profile'
note: 'note this test profile'
YAML
my @yaml_tiny = YAML::Tiny::Load($data);
my @yaml = YAML::Load($data);
print Dumper([\@yaml_tiny, \@yaml]);