how to expand an ini-file in perl -
i need expand ini-file in perl. have given ini-file can read config::inifiles, need add parameters ini file too.
for example file looks like
[section1] param1=val1 param2=val2 [section2] param1=val3 param2=val4
and need add params sections like
[section1] param1=val1 param2=val2 param3=val5 [section2] param1=val3 param2=val4 param3=val6
i don't know if there module in cpan. didn't find 1 until job. thank ideas solve problem!
config::inifiles
allows add parameters in sections: see newval
#!/usr/bin/perl use config::inifiles; $cfg = new config::inifiles( -file => "cfg.ini" ); $cfg->newval("section1", "param3", "val5"); # add new values in corresponding sections ... $cfg->rewriteconfig;
read section bugs rewriteconfig
.
Comments
Post a Comment