my %newhash = %hashcopy; #### use Storable qw(dclone); my %newhash = %{dclone(%hashcopy)};