No such thing as a small change | |
PerlMonks |
Perl Config::Simple with %hash or @arrayby thanos1983 (Parson) |
on Apr 30, 2014 at 01:27 UTC ( [id://1084418]=perlquestion: print w/replies, xml ) | Need Help?? |
thanos1983 has asked for the wisdom of the Perl Monks concerning the following question: Dear Monks, I found out that I can have a common configuration file for Perl and PHP (e.g. conf.ini). While I was reading the CPAN Config::Simple Documentation I found that the user can create a conf file with Blocks and Keys.
My question, is it possible to combine Blocks with hashes or arrays? I can not find relative information on-line. The closest example that I found Perl Config::Simple, sample of working code sligthly modified is provided under:
The test.ini file:
Terminal output:
I tried several different approaches of the code according to my needs trying to achieve the expected outcome, but none successful:
The conf.ini file:
The terminal output:
I assume that I am doing something wrong and there should be a way of implementing the correct output since the conf.ini file is not complaining for wrong syntax Has anyone encounter similar problem/solution? Or I am thinking way too complicated and I should simplify the code by using several lines for the same result? Thanks in advance for your time and effort.
Back to
Seekers of Perl Wisdom
|
|