nisha has asked for the wisdom of the Perl Monks concerning the following question:
The statement $cfg->val ($sec , $i); does not print out the value; However on using!/usr/bin/perl use Config::IniFiles; my $cfg = new Config::IniFiles( -file => "C:/test.ini" ); #Retrieves all the sections in the ini file. @secs= $cfg->Sections(); foreach $i (@secs) { #Retreives all parameters in the section @params = $cfg->Parameters($i); #For each parameter in a particular section print #out the val +ue callme (@params,$i); } sub callme { @params = @_; $sec = $_; foreach $i (@params) { chomp($i); chomp($sec); #This below statement is not printing out the values. print $cfg->val ($sec , $i); } }
i.e directly specifying the section value and the parameter value the values for the same are getting printed but the same not working if variable names are used. Could you please help me solve this problem. Thanks, Nishaprint $cfg->val(Section1,Color)
2006-02-16 Retitled by Arunbear, as per Monastery guidelines
Original title: 'Config::IniFiles.'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getting sections with Config::IniFiles
by holli (Abbot) on Feb 16, 2006 at 10:36 UTC | |
by nisha (Sexton) on Feb 17, 2006 at 04:24 UTC |