Config file handling in Perl -


there plenty of modules in config:: namespace on cpan, limited in ond way or another.

i'm using config::std, fine of time, makes things difficult:

  • more 2 levels of nested directives
  • handling of multiple values per key
  • conf.d directories, i.e. multiple config files merged 1 big config hash

config::std generates blessed hashref after parsing config, applications coded use hashref configuration. i'd prefer not having change this.

what looking universal, lightweight config module produces hashref.

my question is: config modules should consider replacing config::std?

you didn't state data coming from. reading in configuration file , running limit of configuration file itself?

config::std great module. however, meant read , write windows config/ini files, , windows config/ini files flat , simple formats. thus, wouldn't expect config::std more.

if you're using windows config/ini files right now, may need read more complex data structures in future, config::any way go. it'll handle windows config/ini files , using same programming interface, read , write xml, yaml, , json file structures too.

if you're merely trying keep complex data structure in program , don't care reading , writing configuration files, recommend looking @ xml::simple simple reason ...well... simple , can handle sorts of data structures. plus, xml::simple commonly used module, there's lots of on internet if have questions module, , actively supported.

you use config::any, find more complex use, , harder configure. in fact, have install xml::simple (or similar module) in order use it. advantage of config::any is single interface sorts of configuration file formats. way, don't have hack through program if decide switch form windows config/ini xml or yaml.

so, if you're working windows config/ini files now, , need more complex data structure: @ config::any.

if you're merely wanting simple way track complex data structures, @ xml::simple.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -