S
schwarzenschafe
What's a better way to write the following:
%hash = %{$hashref1->{"key"}};
$hashref2 = \%hash;
Assuming $hashref1->{"key"} is a hashref I want to copy (not
reference), and %hash is never used. My best guess is:
$hashref2 = \%{$hashref1->{"key"}};
But that references $hashref1->{"key"} rather than copies it (ie doesnt
work). Google and the docs didn't help me. Thanka,
SS
%hash = %{$hashref1->{"key"}};
$hashref2 = \%hash;
Assuming $hashref1->{"key"} is a hashref I want to copy (not
reference), and %hash is never used. My best guess is:
$hashref2 = \%{$hashref1->{"key"}};
But that references $hashref1->{"key"} rather than copies it (ie doesnt
work). Google and the docs didn't help me. Thanka,
SS