use strict; use Hash::Util qw(lock_keys); my %hash = (); $hash{Erlaubt} = 1; $hash{Test} = 1; $hash{Auch_erlaubt} = 1; lock_keys(%hash); sub foo { my $h = shift; $h->{uhu} = 1; } foo(\%hash);