Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Configuration file design

by ctilmes (Vicar)
on Jan 04, 2005 at 12:17 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-26 08:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found