diotalevi has asked for the wisdom of the Perl Monks concerning the following question:

I get the following error from YAML and I don't understand what's wrong. It looks like ok YAML to me.

~/bin/perl/5.9.4/bin/perl5.9.4 -MYAML=LoadFile -e 'LoadFile("META.yml" +)' YAML Error: Couldn't parse single line value Code: YAML_PARSE_ERR_SINGLE_LINE Line: 6 Document: 1 at /home/josh/bin/perl/5.9.4/lib/site_perl/5.9.4/YAML.pm line 60

META.yml

--- #YAML:1.0 name: Regexp-NamedCaptures version: 0.03 author: - "Joshua ben Jore" <jjore@cpan.org> abstract: Saves capture results to your own variables license: perl generated_by: Module::Build version 0.2611, without YAML.pm

Replies are listed 'Best First'.
Re: Inscrutable YAML parsing error
by Fletch (Bishop) on Jun 21, 2006 at 16:33 UTC

    Quotes are significant to YAML and the item in the sequence for author is throwing it off. I get an error from Syck as well. Surround the whole value with single quotes, or use a block scalar indicator.

    --- #YAML:1.0 name: Regexp-NamedCaptures version: 0.03 author: - |- "Joshua ben Jore" <jjore@cpan.org> abstract: Saves capture results to your own variables license: perl generated_by: Module::Build version 0.2611, without YAML.pm

    Update: Reworded to (hopefully) clarify exactly what I meant by surround with quotes.

      Ok, thanks. I surrounding it with single quotes and that caused it to work.

      ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Re: Inscrutable YAML parsing error
by rblasch (Monk) on Jun 21, 2006 at 16:55 UTC