use Data::Dumper; my %HoH = ( flintstones => { husband => "fred", pal => "barney", }, jetsons => { husband => "george", wife => "jane", "his boy" => "elroy", # Key quotes needed. }, simpsons => { husband => "homer", wife => "marge", kid => "bart", }, ); sub new { my $class = shift; my %self = %HoH; bless \%self, $class; } sub updatename{ my ($self, $keyname, $keysubname,$keyvalue)=@_; $self->{$keyname}{$keysubname}= {$keyvalue}; } print Dumper(%HoH); updatename("flintstones","husband","joe"); print Dumper(%HoH);