in reply to I don't understand hash references

$k3 = %{$hashr->{ $k1 }->{ $k2 }};

is analogues to

$k=%hash

$k3 is not a hashref but the scalar-value of a hash (... which produces something mostly useless like 1/8 indicating the memory use)

what you really want is either

$k3 = $hashr->{ $k1 }->{ $k2 };

to get the hashref

or

%h3 = %{$hashr->{ $k1 }->{ $k2 }};

to copy the nested sub-hash!

Cheers Rolf