in reply to Modify hash reference itself
It sounds like it would be better for you to not have a hash %myhash but a hashref $myhash instead. Then you can pass it to mergetwohashes and modify $_[0] there to change what hash it points to.
1 I think that will even work with your sub as is, given the magic nature of assignment to glob and dereferencing a glob.
2 Actually not quite true, as you can tie %{$_[0]} in your sub and make %myhash appear to reference a different hash.
|
|---|