The reason for NOT getting the output that you want -- IOW, both $hash{'fact 1'} and $hash{'fact 2'} get the same contents in hash references -- is that %param_hash is sticky in your loop. During the looping, you keep filling the %param_hash, which you assign to any key in %hash.