
use Config::IniFiles;
#use ...;

# Ini file
my $fichier = "testConfig.ini";
my $o_cfg;
    if (-e $fichier) { 
	  # Ini file exists
	  print "le fichier $fichier existe\n";
      $o_cfg=Config::IniFiles->new(-file=>$fichier);
     } else { 
	  # Ini file doesn't exists
      print "le fichier $fichier n'existe pas => on le crée\n";
	  $o_cfg=Config::IniFiles->new();
      $o_cfg->SetFileName($fichier);
    };
# Interpret the ini file
$o_cfg->AddSection ( "BelleSection" );
my @comment = ("# la premiere section", "a etudier de pres");
$o_cfg->SetSectionComment("Section1", @comment);
$newvalue=1;
$o_cfg->setval('Section2','Param3',$newvalue) || $o_cfg->newval('Section2','Param3',$newvalue);
$o_cfg->DeleteSection('Section3');
my @groupes =  $o_cfg->Groups();
print("@groupes\n");
# Set configuration parameters

# A specified parameter value overrides and sets the .ini value

$newvalue="titi";
$o_cfg->setval('EXEMPLE','ARGUMENT',$newvalue) || $o_cfg->newval('EXAMPLE','ARGUMENT',$newvalue);


# Write the .ini file
$o_cfg->RewriteConfig;



	 