I'm mostly interesting in localization of variables with lixical scope.
As you already point out, local
acts on the symbol table of the respective package, i.e. on global variables. In your case, I don't see a way how you can have a single hash element automatically restored at the end of the block.
If this feature is really important to you, did you consider a package global variable declared with "our" (i.e. a lexically scoped global variable) as an alternative?
However, I personally would restore the hash entries manually at the end of the block.
Ronald Fischer <firstname.lastname@example.org>