ingydotnet / yaml-libyaml-pm

Perl Binding to libyaml
http://search.cpan.org/dist/YAML-LibYAML/
33 stars 37 forks source link

Load("{a}: b") #31

Open pipcet opened 9 years ago

pipcet commented 9 years ago

(I hope I'm testing this with the right source code. Please ignore it if it's not reproducible.)

This isn't a major problem, but I was a little surprised to see

perl -MYAML::XS -MData::Dumper -e 'warn Dumper Load("{a}: b")'

produce

$VAR1 = {
          'HASH(0x76cb88)' => 'b'
        };

(note that HASH(0x76cb88) is a string, and in fact the actual hash has been destroyed at this point) rather than warning or croaking on the input. It would be nice to have the option of parsing such data as an alternating sequence (but that would make actual sequences less nice as they'd turn into [0, x, 1, y, 2, z]-style alternating sequences), I think.

guest20 commented 6 years ago

Alternate suggestions: