Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Pass the YAML please

by logie17 (Friar)
on Jan 29, 2007 at 02:05 UTC ( #597005=perlquestion: print w/replies, xml ) Need Help??

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

I'm just getting my feet wet with YAML, and a quick search on cpan reveals a number of modules to load/dump yaml files into perl structures. Any suggestions as to what is good, not so good, and bad? I found YAML::Tiny, which appears to do exactly what I need, any thoughts?

Thanks,
s;;5776?12321=10609$d=9409:12100$xx;;s;(\d*);push @_,$1;eg;map{print chr(sqrt($_))."\n"} @_;

Replies are listed 'Best First'.
Re: Pass the YAML please
by xdg (Monsignor) on Jan 29, 2007 at 03:06 UTC

    If your needs are simple, e.g. config files, then YAML::Tiny may be sufficient. Here's how they compare:

    • YAML -- the "official" standard, implemented in pure Perl, but very "heavy" due to the flexibility it offers

    • YAML::Syck -- XS implementation using the libsyck library; fastest

    • YAML::Tiny -- a pretty full subset of YAML in less than 100 lines of pure Perl

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Re: Pass the YAML please
by dragonchild (Archbishop) on Jan 29, 2007 at 02:35 UTC
    Unless you have a specific need, YAML::Syck (written by Audrey) and YAML (written by Ingy) are considered the gold standards. The first is an overylay on the Syck library (written in C) and the second is a PurePerl module.

    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
Re: Pass the YAML please
by geekphilosopher (Friar) on Jan 29, 2007 at 02:35 UTC
    I use YAML::Syck and have never had any problems with it. The heavy lifting stuff is written in C for speed.
Re: Pass the YAML please
by gaal (Parson) on Jan 29, 2007 at 05:43 UTC
    They have compatible APIs so use the best one available for your purposes. In your case I'm guessing that's Tiny, Syck, or pure, in that order?

    use Best [[qw(YAML::Tiny YAML::Syck YAML)], [qw(Dump Load)]];

    But make sure to test YAML::Tiny with your data, and shift it off the list if it breaks.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://597005]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2021-06-22 17:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (108 votes). Check out past polls.

    Notices?