http://www.perlmonks.org?node_id=742980


in reply to YAML::TINY and module install test

At first glance, your YAML appears incorrectly formatted. The - order lines should be indented two spaces. I'm also dubious about your having two item: fields under - order. Do you know that those are hash keys, and that the second will tend to clobber the first?

I wonder if you've read sufficiently about the modules you are using. Perhaps you need to try going from perl data structures to YAML, to see what the formatting should be.

I would try the following (possibly valid) YAML:

--- email: goose@gmail.com orders: - order: wb090130 item: 0001 item: 0002 price: 3.98 downloads: 3 - order: wb090131 item: 0003 item: 0004 price: 3.98 downloads: 5 total: 7.96 ...
UPDATE: YAML should end with '...'

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

    Well I think your right I need to study the format of the expected yaml file. I used your excellent suggestion and created lines to write out a yaml file which worked, and which i could read, so it was my bad.

    But the documention of the module leaves alot to be desired, so for now i'll just stick with rolling my own storage flatfile...

    manythanks for all the help!



    Learning Perl, one %hash at a time....
      But the documention of the module leaves alot to be desired, so for now i'll just stick with rolling my own storage flatfile... manythanks for all the help!

      That sounds like you're giving up :) its not easy to get ahead reinventing wheels. http://yaml.org/
      AppConfig...

      Yes I plan on coming back to it, :) but for now its easier to make a data file I understand than trying to understand someone else's creation... I'm not doing anything complicated atm. Data::dump looks like a quick to understand module if i need something more robust, app::config seems like it might be worth looking at too sometime.



      Learning Perl, one %hash at a time....