lock %hash; $hash{ existingkey } = newvalue; # or $hash{ newkey } = newvalue; #or delete $hash{ existingkey };