如何在Perl中管理配置文件? [英] How do you manage configuration files in Perl?

查看:234
本文介绍了如何在Perl中管理配置文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个程序必须从PHP脚本读取配置文件,并且快速搜索已经发现有几十种方法来处理Perl中的配置文件:

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:

  • Config data in a separate file
  • AppConfig
  • Config::General
  • Config::IniFiles
  • Config::Scoped
  • Config::Simple
  • ConfigReader::Simple
  • And many others

Brian提供概述此处

Brian provides an overview here.

配置:: Simple将为我工作,因为现有的文件是类似INI的。我有兴趣知道他们的代码中经常使用什么风格?

Config::Simple will work for me, since the existing file is INI-like. I am interested to know what style people regularly use in their code though?

推荐答案

我非常喜欢使用 YAML 配置文件。我发现他们是非常可读和容易操纵。它们自然适合Perl,主要构造是Arrays和Hashes。

I quite like using YAML configuration files. I find them to be very readable and easily manipulated. They fit naturally into Perl as well as the primary constructs are Arrays and Hashes.

这篇关于如何在Perl中管理配置文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆