#/usr/bin/perl use strict; use warnings; $|++; require 5.008; use Hash::Util; my %hash= ( one => undef, two => 2, three => 'abc', ); Hash::Util::lock_keys( %hash ); print $_,$/ for keys %hash; ## causes runtime error $hash{add}= 'yes';