use Config::Std; read_config 'test.cfg' => my %config; print $config{"MYSECTION"}{"element"} . "\n"; $config{"MYSECTION"}{"element"} = [ $config{"MYSECTION"}{"element"}, "test2", ]; write_config %config;