#!/usr/bin/perl

use strict;
use warnings;
use Hash::Util qw(lock_keys unlock_keys lock_hash unlock_hash lock_value unlock_value);

my %hash1=(one =>'first', two=>'second', three=>'third');
lock_keys(%hash1);                   

unlock_keys(%hash1);                 

my %hash2;
lock_keys(%hash2,'one','two','six'); 
lock_value(%hash2,'one');            
lock_value(%hash2,'two');            
unlock_value(%hash2,'two'); 