in reply to Question concerning Perl module Config::IniFiles

You can use Config::INI::Reader::Ordered to read the input INI file in to an array, so that the order can be preserved. For creating the output file in a specific order, you will need to use the write_string method of Config::INI::Writer.

Update: Or just print $out "$key = $value\n"; since the format is so simple.