Why do you have to use $obj in the call to Foo()?
Shouldn't you simply use the %hash value to create
%newhash?
The basic problem that I see is that $obj doesn't
know anything about the class %hash was tied to,
so there is no simple way to implement Foo($obj).