Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Configuration file design

by ctilmes (Priest)
on Jan 04, 2005 at 12:17 UTC ( #419217=note: print w/ replies, xml ) Need Help??

in reply to Configuration file design

I like YAML:
root: '/path/to/root' filepath: '/path/to/files' ftp_instances: - sourcepath: '/source/path/on/server' savepath: '/save/files/here' - sourcepath: savepath: - sourcepath: savepath:
(Though, as noted, it is sensitive to whitespace, YAML returns nice error messages, including a program usable code, a human usable error message and the line number of any error.)

Reading that YAML file returns this perl structure:

$VAR1 = { 'ftp_instances' => [ { 'savepath' => '/save/files/here', 'sourcepath' => '/source/path/on/server' }, { 'savepath' => '', 'sourcepath' => '' }, { 'savepath' => '', 'sourcepath' => '' } ], 'filepath' => '/path/to/files', 'root' => '/path/to/root' };

Replies are listed 'Best First'.
Re^2: Configuration file design
by rje (Deacon) on Jan 04, 2005 at 15:01 UTC
    I prefer YAML, also. It has the high signal-to-noise ratio of traditional config files, while also providing an elegant way of representing heirarchical data -- even quite complex data. And the reference support is cool, too. And I like Ingy's YAML module.

    But then, I tend to see the world monochromatically... I tend to grab one tool (a hammer) and view the rest of the world as a nail...

    And while I'm thinking about it, I'll reference a warning in this thread: 347905

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://419217]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2016-08-27 23:45 GMT
Find Nodes?
    Voting Booth?
    The best thing I ever won in a lottery was:

    Results (390 votes). Check out past polls.