Config::Std 使用

前端之家收集整理的这篇文章主要介绍了Config::Std 使用前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1. windows安装

ppm install Config::Std


2. 查看文件变化

html增加了Std.html,site目录也增加了Class::Std.pm 和Config::Std.pm 是否将此文件直接复制过来就可以了??

实验证实了,可以移动文件到其他机器上,去掉2个文件的use version; $VERSION = qv('0.0.9'); 就可以了直接用了。

@H_301_23@



3. 测试

#!perl -w
use strict;
use Config::Std;
use Data::Dumper;
read_config 'Demo.ini' =>my %DemoConfig;

print Dumper(\%DemoConfig);


Demo.ini文件内容

[MAIN]
FILENUMBER=4
DEMO=AAAAAA


[FILE1]
TEXT=BBB
VALUE=CCC

[FILE2]
TEXT=BBBc
VALUE=CCCd


执行结果如下:

@H_301_23@



4. linux 安装

先安装 Class-Std-0.011.tar.gz

再安装Config-Std-0.900.tar_.gz

安装步骤:

perl Makefile.pl

make

make test

make install

猜你在找的Perl相关文章