NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
So many to choose from (Score:1)
I've come to like using Catalyst::Plugin::ConfigLoader as a straightforward way of getting a text config into a hash.
C::P::CL is built on top of the excellent Config::Any, so you can use
Unfortunately, C::P::CL is built into Catalyst, so I (plug) wrote a factored out version called Config::JFDI
If you're not afraid of a few dependencies, then you should give Config: [cpan.org]
I tend to agree (Score:2)
In my experience, YAML is a read-only format. It's probably just that I haven't used it enough but every time I try to hand craft YAML I get bitten by the subtleties.
I had a brief flirtation with XML and a config file format some years ago and I still paying the price :-)
I've used hand-rolled parser code for ini-style configs a number of times recently. I haven't bothered with implementing [sections] but often need to include multi-value items. The way I tend to handle that is by putting an '@' prefi
Re: (Score:2)
@JAPH = qw(Hacker Perl Another Just);
print reverse @JAPH;
My favorite configuration format is (Score:1)
Re: (Score:1)
Config::Tiny (Score:1)
Or alternatively, cut and past Config::Tiny into your code as Module::Config.
Re: (Score:2)
Re: (Score:1)
s/^\s*//;
s/\s*$//;
Surely you never want to match 0 spaces, so why not use s+? (That's an English ?, not a Perl one).
Re: (Score:1)
s/^\s*something//;
Re: (Score:2)