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:
Script:VoiceDigit = BASIC_testcase.txt [mySubSection] foo = bar
Output: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__
BASIC_testcase.txt bar
Hope this helps!
|
|---|