!/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 value 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); } }