in reply to Re^2: YAML::TINY and module install test
in thread YAML::TINY and module install test

YAML::Tiny seems to think your yaml file isn't properly formatted. Since you're on OS X, and ysh thinks your yaml is fine, its probably a bug in YAML::Tiny (missing binmode). You could probably work around it with
use open IN => ':bytes'; use YAML::Tiny; ....
If that fixes it, you should report the bug.

Replies are listed 'Best First'.
Re^4: YAML::TINY and module install test
by porcustal (Initiate) on Feb 11, 2009 at 05:19 UTC

    Hmm didn't make any difference when i just added that. But then going on the thought that its a file encoding issue I switched from SubethaEdit to vim and remade the customers.yml then reran the script and got a new error :)

    Bad or unsupported hash line at /usr/local/lib/perl5/site_perl/5.10.0/YAML/Tiny.pm line 279.

    Learning Perl, one %hash at a time....
      Hmm, I kind of doubt it :) You probably forgot something again. Try this
      #!/usr/bin/perl -- use strict; use warnings; my( $VAR1, $VAR2 ); $VAR1 = { 'email' => 'goose@gmail.com', 'orders' => [ { 'downloads' => '3', 'order' => 'wb090130', 'item' => '0001', 'price' => '3.98' }, { 'downloads' => '5', 'order' => 'wb090131', 'item' => '0003', 'price' => '3.98' } ], 'total' => '7.96' }; $VAR2 = { 'email' => 'cowboy@bebop.com' }; use open qw' IN :bytes OUT :bytes '; use YAML::Tiny qw[ LoadFile DumpFile ]; use Data::Dumper; $Data::Dumper::Indent=1; warn DumpFile('test.yml', $VAR1, $VAR2); print Dumper(LoadFile( 'test.yml' ));
      Then compare both your failing yml files this YAML::Tiny generated test.yml, use od -tacx1 or hexdump.