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

Having played with the RoR framework, I have become interested in using YAML as a means of setting up configuration files for some of my Perl scripts. I more commonly use ActiveState in a Windows environment so started looking at the binaries available thru the Perl Package Manager. What I did find was rather dis-hearting in that the build status of all YAML related packages did not look so good; FAIL with test results of dubious. Since all I really want to do is use simple configuration file layout to initialize some of my scripts (providing scallars and hashes) and hope that that some of these modules will catch up with what Ruby and Python are doing in the near future. Is there anything that out there that anyone could recommend?
What about an easy to use non-YAML solution?
Thanks
ab_iron

Replies are listed 'Best First'.
Re: ActiveState Perl and YAML; dubious?
by shmem (Chancellor) on Jun 12, 2007 at 21:55 UTC
    If your config data is only read by perl, write the config data in plain perl, and load the files via require. If you need your data to be portable between applications, use XML.

    Writing plain perl has the disadvantage of curlies, brackets, parens and commas - and the big advantage of being perl. If you need a config file format with less line noise and (probably) understandable for non-perl people, have a look at Config::Simple.

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
      Plain Perl is out since I do need to allow non-perl people set their own configurations. I will take a look at Config::Simple but am getting a little Syck and am liking it.

      ab_iron
Re: ActiveState Perl and YAML; dubious?
by jettero (Monsignor) on Jun 12, 2007 at 22:43 UTC
    YAML::ConfigFile seems to come with the standard distribution.

    Curiously, it doesn't seem to be on cpan... But it may suit your purposes.

    -Paul

Re: ActiveState Perl and YAML; dubious?
by syphilis (Archbishop) on Jun 13, 2007 at 05:05 UTC