How do you manage configuration files in Perl?

后端 未结 4 1557
失恋的感觉
失恋的感觉 2020-12-06 01:00

I have a program that has to read a configuration file from a PHP script, and a quick search has revealed there are dozens of ways to handle configuration files in Perl:

4条回答
  •  攒了一身酷
    2020-12-06 01:23

    If the audience is technical (used to formatted data structures), then I like using JSON for configuration. In your program it'll work like if you used YAML, but to me it's easier to read (and we use lots of JSON anyway).

    If you use JSON::XS there's a "relaxed" option that'll allow comments and trailing commas and such in the files.

提交回复
热议问题