Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the YAML CPAN distribution.

Report information
The Basics
Id: 7146
Status: new
Priority: 0/
Queue: YAML

People
Owner: Nobody in particular
Requestors: ybug [...] bereft.net
Cc:
AdminCc:

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



Subject: scalar with many spaces doesn't round trip
Download (untitled) / with headers
text/plain 370b
I found a problem round tripping a string containing a large number of spaces: perl -MData::Dumper -MYAML -e '$orig = "A".(" "x200)."B"; $roundtrip = Load Dump $orig; print Dump($orig,$roundtrip); print Dumper([$orig,$roundtrip])' Pipe through cat -A to see the differences. It seems like the loading of flow scalars isn't working right. This is with version 0.35.
Subject: looks like a dump heuristics issue
Download (untitled) / with headers
text/plain 470b
Reading the YAML spec, it seems that the loading is right but that the block scalar format should be used to preserve whitespace during the dump. It looks like the length > 50 heuristic in _emit_str is what's forcing multiline output and then the "or ($_[0] =~ /^\S[^\n]{76}/m)" condition means it uses folding instead of a block. There doesn't seem to be a way to force block output in this case. Maybe the above regex could have (?!\s) added to the end? Brad


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.