Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Configuration file design

by ctilmes (Vicar)
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2018-06-18 02:44 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (107 votes). Check out past polls.