in reply to Read INI file

Hi bhushanQA,

Reading from a config file is a common task. If you've come up with a format that is difficult to process, change it, to standard INI-format, or YAML, or something that one of the many existing tools can read with no modification.

Change your format to a normal Windows-style ini file and you can use Config::Tiny:

Config file contents:

VoiceDigit = BASIC_testcase.txt [mySubSection] foo = bar
Script:
use strict; use warnings; use feature 'say'; use Config::Tiny; my $conf = Config::Tiny->read('1159584.ini'); say $conf->{_}->{'VoiceDigit'}; say $conf->{'mySubSection'}->{'foo'}; __END__
Output:
BASIC_testcase.txt bar

Hope this helps!


The way forward always starts with a minimal test.