my $config = Config::Tiny->read('SQLdata.ini'); foreach my $section (keys %$config) { print "[$section]\n"; foreach my $parameter (keys %{$config->{$section}}) { print "$parameter = $config->{$section}->{$parameter}\n"; } #return $parameter; } #### [insert] SQL1 = insert into table SQL2 = insert into table SQL3 = insert into table SQL4 = insert into table [Truncate] SQL1= truncate table SQL2= truncate table [update] SQL1 = update into SQL2 = update into output is: [Truncate] SQL2= truncate table SQL1= truncate table [insert] SQL4 = insert into table SQL2 = insert into table SQL3 = insert into table SQL1 = insert into table [update] SQL2 = update into SQL1 = update into