With respect to the capitalization comment:
I see what is going on. Believe it or not, Locale::Codes is not capitalizing your change... but it IS treating aliases as case insensitive.
When you rename the country to 'the Russian Federation', it checks to see if there is an alias by that name (and aliases are stored in a case insensitive hash... i.e. all lowercase), and 'The Russian Federation' is already listed as an alias, so Locale::Codes is just assuming that you want to use that alias.
If you rename it to 'a Russian Federation' (which does not already exist), then the return value is capitalized as passed in.
I understand that this is a nuisance, and I could fix it by making the alias hash case sensitive. It's a bit of work... but not undoable by any means.
I want to consider it for a while, so I'll add it to my TODO list, and look at it as a possible change for the next release.
With respect to the 'more serious issue'... I'm afraid you're trying to do something bad here. There are two countries named 'The Republic of Korea' and 'The Democratic People's Republic of Korea' and you're trying to rename one to be the other. Locale::Codes gives a fatal error. I maybe could make the error non-fatal, but I certainly won't add support for the rename to occur.
Hope that clarifies things.