你如何在 Perl 中管理配置文件? [英] How do you manage configuration files in 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:
Brian 在此处提供了概述.
Brian provides an overview here.
Config::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,主要结构是数组和哈希.
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屋!