```{index} single: lock_value; Hash::Util function ``` ```{index} single: Hash::Util::lock_value; Perl function ``` # lock_value Make the value under a given key immutable. ## Synopsis lock_value(%hash, $key); Any subsequent attempt to overwrite `$hash{$key}` croaks with `Modification of a read-only value attempted`. The key itself remains deletable unless `lock_keys` has also been applied — once the key is deleted, a later assignment creates a fresh (writable) value. Values not already present are silently ignored. Returns a reference to the hash.