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

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' };


Comment on Re: Configuration file design
Select or Download Code
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
Node Status?
node history
Node Type: note [id://419217]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2014-04-18 06:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (462 votes), past polls