YAML::PP Grant Report February 2018

Hi there,

I had another busy month and did only hack a bit. I'm even so busy that I forget to use my time tracker, so I estimate about 20 hours.

See also my previous reports on blogs.perl.org (Aug/Sep, Oct, Nov, Dec, Jan )

Strings in YAML - To Quote or not to Quote

This article covers scalar styles in YAML 1.1 and 1.2. It mostly works the same in both versions.

YAML is a data serialization language, and one design goal was that it's human friendly. It should be easy to read and edit, even if that makes parsing it harder.

Let's look at strings, specifically.

If you look at JSON, you have only one style to encode strings, and that's the double quoted style which doesn't allow literal linebreaks.

YAML files are used for many different purposes, and there are many types of strings, especially multiline strings. For each use case, you can choose the type of quoting (or no quoting) that makes the string readable and easy to edit.

This gives you lots of freedom, but you also have to learn using it to avoid mistakes.

The good news is, the YAML double quoted string works the same as in JSON, so if you know that already, you will be able to write correct YAML. (I should note, though, that it also depends on the processor you use, since not all are fully JSON compatible. The incompatible cases should be rare, though.)

You basically have five ways to express a string:

Table of Contents:

  • Quick comparison
  • Flow Scalars
    • Plain Scalar
    • When not to use Plain Scalars
    • Single quoted Scalar
    • Double quoted Scalar
  • Block Scalars
    • Block Scalar Types
    • Literal Block Scalar
    • Folded Block Scalar
    • Comments
    • Empty Lines at the beginning
    • Special Block Scalar Indicators
    • Block Scalar Chomping
    • Block Scalar Indenting
  • Summary

Safely load untrusted YAML in Perl

Usually people deal with YAML files from trusted sources. But maybe you want to load input from a Website as YAML. This can lead to problems, and this article will talk about what you can do to make the loading safe.

The problems I'll talk about are loading objects, cyclic references and general parsing problems.

I will cover YAML.pm, YAML::Tiny, YAML::XS, YAML::Syck and YAML::PP.

YAML::PP Grant Report January 2018


thanks for reading my report. This report will be quite short because I have been busy with other things, and a lot of time went into discussions rather than coding, and I never logged time for discussions.

I have been working on YAML::PP about 10 hours.

See also my previous reports on blogs.perl.org (Aug/Sep, Oct, Nov, Dec )

YAML::PP Grant Report December 2017

Hi there!

Thanks for reading my report. In the last report I included a mini tutorial about string quoting methods in YAML. This time I've written an introduction into YAML Schemas and Tags.

In December I have been working about 60 hours on YAML::PP, YAML::XS, libyaml and the Schema article.

See also my previous reports on blogs.perl.org (Aug/Sep, Oct, Nov ) and news.perlfoundation.org (Aug/Sep, Oct, Nov ).