in reply to Re^3: YAML newbie help
in thread YAML newbie help

I see. I always start with `perldoc YAML', so I would've approached the problem the same way grinder would, akin to
use YAML; my( @foo ) = ({ 'date' => '2005-06-01', 'boss' => 'Clara', 'team' => [ 'Jack', 'Jill', 'Joe' ] }, { 'date' => '2005-06-02', 'boss' => 'Victoria', 'team' => [ 'Harry', 'Hillary', 'Howie' ] } ); local $YAML::Indent = 4; local $YAML::UseFold = 1; print Dump( \@foo ); __END__ --- - boss: Clara date: 2005-06-01 team: - Jack - Jill - Joe - boss: Victoria date: 2005-06-02 team: - Harry - Hillary - Howie
Too bad there isn't an option yet to compress sequences.

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re^5: YAML newbie help
by Tortue (Scribe) on May 31, 2005 at 11:10 UTC
    > I always start with `perldoc YAML'

    That's what I did too, but the synopsis actually starts with YAML, not with Perl structures.

    grinder and your technique is great for those who are good at thinking in, and writing, Perl data structures. I must shamefully confess that, despite long experience programming Perl, I have trouble distinguishing braces from brackets from curlies, and remembering which does what. So I thought to myself: "Hey, YAML, human-readable! Maybe it can save me from wearing out my AltGr key! (on French keyboard)". But YAML turned out not to be as DWIM as I expected, which isn't surprising. Hence the need for lots of examples for lazy newbies like me.

    Maybe as penance (and when I have time, this was all supposed to be a timesaver...) I'll write up a translation of perldsc into YAML.

      Excellent idea, go for it! I don't recall seeing Manual Guilt work so well before :D Just scan for Declaration of and YAML::Dump() it, shouldn't take long at all

      MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
      I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
      ** The third rule of perl club is a statement of fact: pod is sexy.