Outputs:#!/usr/bin/perl use YAML::Syck; use strict; my $hashref = Load(<<'...'); --- title: This is my title body: | This is some text. Here's a newline: Yet more text. ... print Dump($hashref);
YAML::--- body: "This is some text. Here's a newline:\n\nYet more text.\n" title: This is my title
Outputs:#!/usr/bin/perl use YAML; use strict; my $hashref = Load(<<'...'); --- title: This is my title body: | This is some text. Here's a newline: Yet more text. ... print Dump($hashref);
The output of YAML:: w.r.t to the body element is perfect, but YAML:: is a large module and not very efficient. I'd prefer to use YAML::Syck (or something else), but I need the body block formatted correctly (newlines unescaped, no quotation marks on either side, and starting with the bar (|) charcater) in the output because this block, which is potentially very lengthy, will be edited by humans. What options do I have here?--- body: | This is some text. Here's a newline: Yet more text. title: This is my title
In reply to YAML::/YAML::Syck and Newlines by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |