in reply to Re: Modify a hash via its reference
in thread Modify a hash via its reference
The solution is to not change the reference, but the dereferenced hash:# This line would discard the reference to %Fruits, and create a *new* # hash with the specified values # $Ref_to_Hash = { "Pears", 5, "Peaches", 7 };
%$Ref_to_Hash = ( "Pears", 5, "Peaches", 7 );
|
|---|