sub copy_hash { my $hr = shift // return {}; my $copy; @$copy{keys %$hr} = value %$hr; $copy; }