use Config::IniFiles; # my $cfg = new Config::IniFiles( -file => "configfile.ini" ); # or my %ini tie %ini, 'Config::IniFiles', ( -file => "configfile.ini" ); # do stuff with %ini # create a new section and add values $ini{new_section} = {}; $ini{new_section}{new_param1} = $val; $ini{new_section}{new_param2} = $val2; # add a multiline value $ini{new_section}{new_param2} = [$value1, $value2, ...]; # save with the TIED hash # overwrite the current ini file tied( %ini )->RewriteConfig(); # or you can write to a different file #tied( %ini )->WriteConfig ($NewFilename); # save with object ref # overwrite the current ini file #$cfg->RewriteConfig(); # or you can write to a different file #$cfg->WriteConfig ($NewFilename);